text stringlengths 3 1.18M |
|---|
/*------------------------------------------------------------------------------
** Ident: Sogeti Smart Mobile Solutions
** Author: rene
** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved.
**------------------------------------------------------------------------------
** Sogeti Nederl... |
/*------------------------------------------------------------------------------
** Ident: Sogeti Smart Mobile Solutions
** Author: rene
** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved.
**------------------------------------------------------------------------------
** Sogeti Nederl... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
/*
* Copyright (C) 2010 Just Objects B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
package principal;
import tsb.sax.ContentHandlerModel;
import tsb.sax.SAXException;
import tsb.util.AtributoValor;
/**
* define todos los eventos que se producen a lo largo del documento.
* implementacion del content handler Model que carga el dom
*/
public class ManejadorSAX implements ContentHandlerModel {
... |
package principal;
import tsb.sax.ErrorHandlerModel;
import tsb.sax.SAXException;
/**
*
* Implentacion del error
*/
public class ErrorHandler implements ErrorHandlerModel {
public void errorFatal(SAXException ex) throws SAXException {
String titulo = "ERROR FATAL";
String msg = ex.getMessage()... |
package principal;
import InterfazGrafica.Principal;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import javax.swing.JFileChooser;
import tsb.sax.*;
/**
*
* @author David
*/
public class Lanzador {
privat... |
package principal;
import java.io.File;
import javax.swing.filechooser.FileFilter;
public class XMLFileFilter extends FileFilter {
private String filtrar = ".xml";
@Override
public boolean accept(File f) {
if (f.isDirectory() || f.getName().toLowerCase().endsWith(filtrar))
{
... |
package principal;
import tsb.sax.ContentHandlerModel;
import tsb.sax.SAXException;
import tsb.util.AtributoValor;
import tsb.dom.*;
/**
*
* @author ZV Admin
*/
public class ManejadorDOM implements ContentHandlerModel {
private DomXML doc;
public DomXML getDocumento() {
return doc;
}
pub... |
package principal;
/**
*
* @author David
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
/*
Lanzador lanzadorDePrograma = new Lanzador();
try{
lanzadorDePrograma.ejecutar();
}catch(Exception e){
... |
package principal;
import tsb.sax.ContentHandlerModel;
import tsb.sax.SAXException;
import tsb.util.AtributoValor;
/**
* define todos los eventos que se producen a lo largo del documento.
* implementacion del content handler Model que carga el dom
*/
public class ContentHandler implements ContentHandlerModel {
... |
package tsb.sax;
/**
*
* modelo de validacion
*/
interface IValidador {
public boolean validar(String str);
}
|
package tsb.sax;
/**
* Valida el tipo de tag xml leido
*/
public class Clasificador {
public static final int TAG_INICIO = 0;
public static final int TAG_FINAL = 1;
public static final int TAG_AUTOCONTENIDO = 2;
public static final int CONTENIDO = 3;
public static f... |
package tsb.sax;
import tsb.util.Balance;
import tsb.util.StrCmp;
/**
*
* verifica que el tag xml leido corresponde a un tag de inicio de elemento
*/
class ValidadorTagInicio implements IValidador {
private ValidadorVariables vVariables;
public ValidadorTagInicio() {
this.vVariables = new Validado... |
package tsb.sax;
import tsb.util.StrCmp;
import tsb.util.StrOp;
/**
*
* verifica que el tag xml leido corresponde a un tag de final de elemtno
*/
class ValidadorTagFinal implements IValidador {
String str;
public boolean validar(String str) {
boolean resultado = true;
this.str = str;
... |
package tsb.sax;
import tsb.util.StrCmp;
import tsb.util.StrOp;
/**
* verifica que el tag xml leido corresponde a un comentario
*/
class ValidadorComentario implements IValidador {
private String str;
public boolean validar(String str) {
boolean resultado = true;
this.str = str;
tr... |
package tsb.sax;
import tsb.util.StrCmp;
/**
*
* verifica que el tag xml leido corresponde a contenido
*/
class ValidadorContenido implements IValidador {
public boolean validar(String str) {
boolean resultado = true;
try {
if (StrCmp.esInicioFin(str, "<", ">") == true) {
... |
package tsb.sax;
import tsb.util.*;
/**
*
* verifica que el tag xml leido corresponde a un tag que se cierra solo
*/
class ValidadorTagAutoContenido implements IValidador {
private String str;
private ValidadorVariables vVariables;
public ValidadorTagAutoContenido() {
this.vVariables = new Val... |
package tsb.sax;
import tsb.util.*;
/**
*
* verifica que el tag xml leido corresponde a la informacion del formato de archivo
*/
class ValidadorPrologo implements IValidador {
private String str;
private ValidadorVariables vVariables;
public ValidadorPrologo() {
this.vVariables = new Validado... |
package tsb.sax;
import tsb.util.StrCmp;
/**
*
* @author David
*/
public class ValidadorContenidoCDATA implements IValidador{
public boolean validar(String str) {
boolean resultado = false;
try {
if (StrCmp.esInicioFin(str, "<![CDATA[", "]]>") == true) {
resultado ... |
package tsb.sax;
import java.util.Stack;
import tsb.util.StrOp;
/**
*
* todo elemento que empieza debe terminar
*/
public class ControladorEquilibrio {
private Stack<String> stack;
private boolean esUsado;
private int root;
public ControladorEquilibrio() {
this.stack = new Stack<String>(... |
package tsb.sax;
/**
*
* Modelo del manejador de errores
*/
public interface ErrorHandlerModel {
public void errorFatal(SAXException ex) throws SAXException;
public void error(SAXException ex) throws SAXException;
public void warning(SAXException ex) throws SAXException;
}
|
package tsb.sax;
import java.util.Vector;
import tsb.util.StrCmp;
/**
*
* verifica que el tag xml leido corresponde a una correcta definicion d evariables
*/
class ValidadorVariables implements IValidador {
private String str;
private Vector<String> nombres;
public ValidadorVariables() {
nombr... |
package tsb.sax;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Vector;
import tsb.dtd.*;
import tsb.util.*;
import InterfazGrafica.Principal;
/**
* El parser sax propiamente dicho
* controla el flujo de datos desde los caracteres hacia los cabeceras y las validaciones dtd
*/
public cl... |
package tsb.sax;
import tsb.util.AtributoValor;
/**
*
* interface que define los eventos que voy a utilizar al procesar mi xml
*/
public interface ContentHandlerModel {
public void inicioDocumento() throws SAXException; // para detectar cdo se abre un doc
public void finDocumento() throws SAXException;... |
package tsb.sax;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
*
* Lector de bajo nivel que sabe separar las partes de un xml
*/
public class XMLReader {
private File file;
private BufferedReader reader;
... |
package tsb.sax;
/**
*
* verifica que el tag xml leido corresponde a un inicio de dtd
*/
class ValidadorDTD implements IValidador {
public boolean validar(String str) {
boolean resultado = true;
try {
resultado = str.equals("<!DOCTYPE");
} catch (Exception e) {
... |
package tsb.sax;
/**
*
* Exepcion generica que mantiene el estandar sax
* de Warning Error y Fatal error.
*/
public class SAXException extends Exception {
public static int WARNING = 0;
public static int ERROR = 1;
public static int ERROR_FATAL = 2;
private int tipo;
public SAXException(int t... |
package tsb.util;
import java.util.ArrayList;
/**
*
* DataStructure de cola
*/
public class Cola<E> extends ArrayList<E> {
public void push(E aAgregar) {
super.add(aAgregar);
}
public E peek(){
return super.get(0);
}
public E pop(){
return super.remove(0);
... |
package tsb.util;
import java.util.regex.Pattern;
/**
*
* Metodos para comparar cadenas
*/
public abstract class StrCmp {
private static final int IGUAL = 0;
private static final int MENOS = 1;
private static final int MAS = 2;
public static boolean soloTextoGuionesYEspacios(final String aValida... |
package tsb.util;
import tsb.dtd.DTDReader;
/**
* Exception dtd de bajo nivel que identifica algunas malformaciones
* indetectables en niveles superiores
*/
public class InvalidReadException extends Exception {
DTDReader otroR;
public InvalidReadException(String mensaje, DTDReader otro) {
super(me... |
package tsb.util;
import java.util.ArrayList;
/**
*
* Metodos para operar cadenas
*/
public abstract class StrOp {
public static String getNombreTag(final String str, final String sInicio, final String sFinal) {
String nombre = borrarInicioFin(str, sInicio, sFinal);
nombre = nombre.trim();
... |
package tsb.util;
import java.util.Collection;
/**
*
* Llena una coleccion con un array
*/
public abstract class Coleccion {
public static Collection llenar(final Collection c, Object[] array){
for (int i = 0; i < array.length; i++) {
Object object = array[i];
c.add(object);
... |
package tsb.util;
/**
*
* valida nombres de los tag xml
*/
public abstract class XMLSintaxis {
public static boolean validarNombreTag(final String str, final String sInicio, final String sFinal) {
boolean resultado = true;
int contNombres = 0;
String str0 = StrOp.borrarInicioFin(str, sI... |
package tsb.util;
import java.util.Stack;
/**
*
* Verifica el balanceo de caractertes de apertura y cierre
* como [] {} <>
*/
public abstract class Balance {
public static boolean esbalanceada(final String str, final char c0, final char c1) {
boolean resultado;
if (c0 == c1) {
re... |
package tsb.util;
/**
* Esta clase empaqueta las variables de los XML
* Asi si tenemos un elemento <code>"<lalal atributo="valor">"</code>
* se genera una instancia de esta clase con la sentencia
* <code>new AtributoValor("atributo","valor");</code>
*/
public class AtributoValor {
private String nombre;
p... |
package tsb.dtd;
import tsb.util.Balance;
import tsb.util.StrCmp;
import tsb.util.StrOp;
import tsb.util.XMLSintaxis;
/**
*
* valida el docinfo de un dtd
*/
public class ValidadorSintaxisPrologo {
private String str;
private ValidadorVariables validadorVariable;
public ValidadorSintaxisPrologo() {
... |
package tsb.dtd;
import java.util.Vector;
/**
*
* contiene todos los elementos validados internos a un elemento
*/
public class Box {
private Vector<BoxContenido> content;
public static final int CONTENT = 0;
public static final int ELEMENT = 1;
public Box() {
this.content = new Vector<Box... |
package tsb.dtd;
/**
*
* contiene las reglas correspondientes a un elemento
*/
public class ValidadorItem {
private String nombre;
private String elementInterno;
private String elementExterno;
private String attlistInterno;
private String attlistExterno;
//banderas correspondientes a identi... |
package tsb.dtd;
import java.util.Vector;
/**
*
* Diccionario con las palabras/simbolos reservados de OPCIONALIDAD de atributos
*/
class DiccionarioAtributo implements IDiccionario {
private Vector<String> palabras;
private int tipo;
public DiccionarioAtributo() {
palabras = new Vector<String... |
package tsb.dtd;
import java.util.Vector;
/**
*
* Diccionario con las palabras/simbolos reservados de de opcionalidad de elementos
*/
class DiccionarioElemento implements IDiccionario {
private Vector<String> palabras;
private int tipo;
public DiccionarioElemento() {
palabras = new Vector<Str... |
package tsb.dtd;
import java.util.Vector;
/**
*
* Diccionario con las palabras/simbolos reservados de cardinalidad de elemtos
*/
class DiccionarioSimbolo implements IDiccionario{
private Vector<String> palabras;
private int tipo;
public DiccionarioSimbolo() {
palabras = new Vector<String>();
... |
package tsb.dtd;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Vector;
import tsb.util.*;
import tsb.sax.XMLReader;
/**
*
* Lector de bajo nivel de DTD que sabe ubicar archivos en el sistema
* y generar arrays con las reglas identificadas
*/
public class DTDReader {
priv... |
package tsb.dtd;
import java.util.ArrayList;
import tsb.util.StrCmp;
import tsb.util.StrOp;
/**
*
* valida la sintaxis de un attlist
*/
public class ValidadorSintaxisAttList implements IValidadorSintaxis {
private Diccionario diccionario;
private ValidadorSintaxisAtributo validadorAtributo;
public Val... |
package tsb.dtd;
import java.util.Stack;
import tsb.util.Balance;
import tsb.util.StrOp;
/**
*
* algunos metodos comunes para la validacion sintactica de un dtd
*/
public abstract class DTDTool {
public static int getCantidadSalidasPar(final String str, final char c) {
int n = -1;
boolean esBa... |
package tsb.dtd;
import java.io.FileNotFoundException;
import tsb.sax.XMLReader;
import tsb.util.InvalidReadException;
/**
*
* toma el control del lector de bajo nivel
* lo encapsula en un DTDReader de bajo nive;
* solicita las reglas internas y externas leidas
* genera el validador.
*/
public class DTDParser {... |
package tsb.dtd;
import tsb.util.StrCmp;
import tsb.util.StrOp;
/**
*
* valida la sintaxis de una declaracion de elemento dtd
*/
public class ValidadorSintaxisElement implements IValidadorSintaxis {
private Diccionario diccionario;
private ValidadorSintaxisLista validadorLista;
public ValidadorSintax... |
package tsb.dtd;
import tsb.util.StrCmp;
import tsb.util.StrOp;
/**
*
* Validada de la sintaxis de una relga de un atributo de un attlist
*/
class ValidadorSintaxisAtributo {
private final int LIST = 0;
private final int DATA_TYPE = 1;
private final int ERROR = -1;
private final int REQ ... |
package tsb.dtd;
/**
*
* Modelo de diccionarios
*/
public interface IDiccionario {
public static final int ERROR = -1;
public static final int ELEMENT_OPCIONAL = 0;
public static final int DATA_TYPE = 1;
public static final int ATT_OPCIONAL = 2;
public static final int SIM... |
package tsb.dtd;
/**
*
* Empaqueta errores generados en el moemento de verificar sintacticamente un dtd
* o al validar con su correspondiente xml
*/
public class DTDException extends Exception {
public DTDException() {
}
public DTDException(String msg) {
super("DTD Exception: " + msg);
}
... |
package tsb.dtd;
import tsb.util.StrCmp;
import tsb.util.StrOp;
/**
*
* valida la sitaxis de cada una de la partes de una lista
*/
public class ValidadorSintaxisComponente {
private boolean pcdata;
public boolean Verify(final String component) {
pcdata = false;
boolean toReturn = true;
... |
package tsb.dtd;
import java.util.ArrayList;
import java.util.Iterator;
import tsb.util.StrOp;
/**
*
* intenta generar un validador dtd.
*/
public class DTDGenerarValidador {
private DTDValidadorSintaxis validadorSintaxis;
private DTDValidador validador;
private ArrayList<String> reglas;
private b... |
package tsb.dtd;
/**
*
* modelo de un validador sintactico dtd
*/
public interface IValidadorSintaxis {
public boolean validar (String aValidar);
}
|
package tsb.dtd;
import java.util.ArrayList;
import tsb.util.StrCmp;
/**
*
* valida las variables de un docinfo
*/
class ValidadorVariables {
private String str;
private ArrayList<String> nombres;
public ValidadorVariables() {
nombres = new ArrayList<String>();
}
public void clear() {... |
package tsb.dtd;
import tsb.util.Balance;
import tsb.util.StrOp;
import tsb.util.Cola;
import tsb.util.StrCmp;
/**
*
* validada un elemento xml contra su regla dtd
*/
public class ValidadorElement {
public static int SOLO_UNO = 0;
public static int EMPTY = 1;
public static int ANY = 2;
public stat... |
package tsb.dtd;
import java.util.Iterator;
import java.util.Vector;
/**
*
* diccionarios
*/
public class Diccionario{
private Vector<IDiccionario> diccionario;
public Diccionario() {
diccionario = new Vector<IDiccionario>();
diccionario.add(new DiccionarioTipoDato());
dicciona... |
package tsb.dtd;
import tsb.util.StrOp;
import tsb.util.AtributoValor;
import tsb.util.StrCmp;
/**
*
* valida un atributo individual de un elemento contra su regla individual en un attlist
*/
class ValidadorAtributo {
private Diccionario diccionario;
public ValidadorAtributo() {
diccionario = new... |
package tsb.dtd;
import java.util.ArrayList;
import tsb.util.AtributoValor;
import tsb.util.StrOp;
/**
*
* valida el que los atributos de un elemento correspondan a su declaracion de attlist
*/
public class ValidadorAttList {
private Diccionario diccionario;
private String[] reglas;
public ValidadorAt... |
package tsb.dtd;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Stack;
import tsb.util.*;
/**
*
* valida un xml en tiempo de sax
*/
public class DTDValidador {
private ArrayList<ValidadorItem> reglas;
private Stack<Box> stk;
private String error;
public DTDValidador() {
... |
package tsb.dtd;
/**
*
* validador sintactico de un dtd
*/
public class DTDValidadorSintaxis {
public static final int ERROR = -1;
public static final int ATTLIST = 0;
public static final int ELEMENT = 1;
public static final int ENTITY = 2;
public static final int DOC_INFO = 3;
priva... |
package tsb.dtd;
import java.util.Vector;
/**
*
* Diccionario con las palabras/simbolos reservados de TIPOS de datos
*/
class DiccionarioTipoDato implements IDiccionario {
private Vector<String> palabras;
private int tipo;
public DiccionarioTipoDato() {
palabras = new Vector<String>();
... |
package tsb.dtd;
import tsb.util.StrOp;
/**
*
* valida la sintaxis de una lista interna a una declaracion de elementos
*/
public class ValidadorSintaxisLista {
private ValidadorSintaxisComponente validador;
public ValidadorSintaxisLista() {
this.validador = new ValidadorSintaxisComponente();
... |
package tsb.dom;
/**
* @author Santiago
*
* El patrón Composite sirve para construir objetos complejos a partir de otros
* más simples y similares entre sí, gracias a la composición recursiva y a una
* estructura en forma de árbol. Esto simplifica el tratamiento de los objetos
* creados, ya que al poseer todos e... |
package tsb.dom;
/**
* @author David
*
* En diseño de software, el patrón de diseño Iterador, define una interfaz que
* declara los métodos necesarios para acceder secuencialmente a un grupo de
* objetos de una colección. Algunos de los métodos que podemos definir en la
* interfaz Iterador son:
*
* Primero()
... |
package tsb.dom;
/**
*
* @author Santiago
*/
public class Hoja extends Componente {
public Hoja(String nombre) {
super(nombre);
}
@Override
public void agregar(Componente c) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void borrar... |
package tsb.dom;
/**
*
* @author Santiago
*/
public class DomXML {
private Encabezado encabezado;
private Documento documento;
private Pila pila;
public DomXML(){
this.encabezado = new Encabezado("xml");
this.documento = new Documento("xml_doc");
this.pila = new P... |
package tsb.dom;
import java.util.Vector;
/**
*
* @author David
*/
public class ListaAtributos {
private Vector<Atributo> vector;
public ListaAtributos() {
this.vector = new Vector<Atributo>();
}
public Vector<Atributo> atributos(){
return (vector);
}
}
|
package tsb.dom;
/**
*
* @author Santiago
*/
public class ValorAtributo {
private int tipoValor;
private String valor;
public ValorAtributo() {
this.tipoValor = 0; // 0 - texto, 1 - CDATA
this.valor = "";
}
public ValorAtributo(int tipoValor, String valor) {
this.ti... |
package tsb.dom;
import java.util.Iterator;
/**
*
* @author Santiago
*/
public class Elemento extends Compuesto {
private ValorAtributo valor;
private ListaAtributos listaAtributos;
public Elemento(String nombre) {
super(nombre);
valor = new ValorAtributo();
listaAtributos = ne... |
package tsb.dom;
import java.util.Vector;
/**
*
* @author Santiago
*/
public class Compuesto extends Componente {
private Vector<Componente> vector;
private Iterador iteradorComponente;
public Compuesto(String nombre) {
super(nombre);
vector = new Vector<Componente>();
iterador... |
package tsb.dom;
/**
*
* @author Santiago
*/
public class Atributo extends Compuesto {
private ValorAtributo valor;
public Atributo(String nombre, ValorAtributo valor) {
super(nombre);
this.valor = valor;
}
public Atributo(tsb.util.AtributoValor atributo) {
super(atributo.... |
package tsb.dom;
/**
*
* @author Santiago
*/
public class Documento extends Compuesto {
public Documento(String nombre) {
super(nombre);
}
public void agregar(Componente padre, Componente hijo) {
if(padre == null){
this.agregar(hijo);
}
else{
pad... |
package tsb.dom;
import java.util.Vector;
public class Pila {
private Vector<Componente> pila;
/**
* Pila(LIFO)
*
*/
public Pila() {
pila = new Vector<Componente>();
}
public Boolean esPilaVacia(){
return(pila.size() == 0);
}
public void escrib... |
package tsb.dom;
/**
*
* @author Santiago
*/
public class Encabezado extends Compuesto {
public Encabezado(String nombre) {
super(nombre);
}
@Override
public String toString() {
Iterador iterador;
String aux = "#ELEMENTO# : " + super.getNombre();
iterador = this.It... |
package InterfazGrafica;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
im... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
import Utilidades.IIterador;
import java.util.ArrayList;
/**
* Iterador que se utiliza para recorrer los diferentes nodos de la estructura
* jerárquica del XML, representada por patrón Composi... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
import java.util.ArrayList;
/**
* Representa un elemento, en este caso una etiqueta
* @author Administrador
*/
public class Elemento extends Compuesto {
private Atributo contenido; //con... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
import Utilidades.IIterador;
import java.util.ArrayList;
/**
* Representa un nodo de la estructura recursiva del arbol XML representado a traves de un Composite
* con la implementacion de la ... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
import Utilidades.AtributoEtiqueta;
/**
* Representa el contenido o atributo de un elemento (etiqueta)
* @author Administrador
*/
public class Atributo extends Compuesto{
//Constantes qu... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
/**
* Representa el documento XML en memoria.
* @author Administrador
*/
public class Documento extends Compuesto {
/**
* Comstructor que recibe el nombre
* @param nombre nomb... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
import Utilidades.IIterador;
/**
* Interface que determina los metofos que deben implementar los nodos de la
* estructura jerárquica del patrón Composite
* @author Administrador
*/
public i... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM.Estructura;
/**
* Representa el prologo del XML con todos sus atributos
* @author Administrador
*/
public class Encabezado extends Compuesto {
/**
* Crea el encabezado que representa el prologo ... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package DOM;
import DOM.Estructura.Atributo;
import DOM.Estructura.Encabezado;
import DOM.Estructura.Elemento;
import DOM.Estructura.IComponente;
import DOM.Estructura.Documento;
import java.util.ArrayList;
/**
* Cre... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Utilidades;
/**
* Interface que determina los métodos bàsicos necesarios que deben implementar
* las diferentes implementaciones de iteradores para recorrer tipos particulares
* de lementos
* @author Adminis... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Utilidades;
import java.io.*;
/**
* Lee el archivo XML
* @author Administrador
*/
public class LectorXML {
private File f; //Archivo a leer
private BufferedReader lector; //
private boolean eof... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Utilidades;
/**
*
* @author Administrador
* Esta clase empaqueta los atributos de las etiquetas del XML
* Asi si tenemos un elemento <code>"<etiqueta atributo="valor">"</code>
* se genera una instancia de ... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Utilidades;
import java.util.ArrayList;
/**
*
* @author Administrador
*/
public class Cola<E> extends ArrayList<E> {
public void push(E aAgregar) {
super.add(aAgregar);
}
public E peek... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.