public interface XMLElementInterface
| Modifier and Type | Method and Description |
|---|---|
XMLElementInterface |
appendValue(String value,
boolean newLine)
Adiciona um valor textual (append) ao elemento XML.
|
String |
convertTextToXML(String text)
Deprecated.
|
void |
convertValueFromXML()
Converte o valor armazenado, trocando < por < etc.
|
void |
endTag(List<XMLElementInterface> childrenList)
Método executado quando a tag de fim do elemento XML é encontrada.
|
Object |
getAppContextObject()
Retorna o contexto da aplicação.
|
Object |
getAppObject()
Retorna o objeto da aplicação associado a este elemento.
|
boolean |
getAttributeBooleanValue(String name)
Retorna
true se o valor do atributo é igual a
"true" (case-insensitive), false caso contrário. |
double |
getAttributeDoubleValue(String name)
Retorna o valor real associado a um atributo.
|
int |
getAttributeIntValue(String name)
Retorna o valor inteiro associado a um atributo.
|
List<? extends XMLAttribute> |
getAttributes()
Retorna a lista de atributos do elemento.
|
String |
getAttributeStrValue(String name)
Recupera o valor associado a um atributo.
|
double |
getDoubleValue()
Retona o valor associado ao elemento como um
float. |
float |
getFloatValue()
Retorna o valor associado ao elemento como um
float. |
int |
getIntValue()
Retorna o valor associado ao elemento como um
int. |
long |
getLongValue()
Retorna o valor associado ao elemento como um
long. |
String |
getStrValue()
Retorna o valor do elemento como string.
|
String |
getTag()
Retorna a tag associada ao elemento.
|
boolean |
hasAttribute(String name)
Indica se o elemento possui o atributo dado.
|
boolean |
hasValue()
Indica se o valor associado ao elemento é diferente da string vazia.
|
boolean |
isEmpty()
Indica se o valor do elemento é uma string vazia ou é constituído apenas
por espaços ou terminadores de linha.
|
XMLElementInterface |
newAttribute(String name,
boolean value)
Instancia um novo atributo que tem como valor um booleano.
|
XMLElementInterface |
newAttribute(String name,
double value)
Instancia um novo atributo que tem como valor um
double. |
XMLElementInterface |
newAttribute(String name,
Enum<?> value)
Instancia um novo atributo que tem como valor uma constante de um
Enum. |
XMLElementInterface |
newAttribute(String name,
int value)
Instancia um novo atributo que tem como valor um número inteiro.
|
XMLElementInterface |
newAttribute(String name,
long value)
Instancia um novo atributo que tem como valor um número inteiro (long).
|
XMLElementInterface |
newAttribute(String name,
String value)
Instancia um novo atributo XML para o objeto.
|
XMLElementInterface |
newAttributeList(List<XMLAttribute> newAttrs)
Redefine os atributos do elemento baseado em um novo mapa.
|
void |
newCharsEvent(char[] charArray,
int start,
int length)
Callback associada ao evento characters(), gerado quando um elemento CDATA
é capturado.
|
void |
resetAttributeList()
Limpa a lista de atributos.
|
XMLElementInterface |
resetValue()
Define valor nulo para o elemento.
|
XMLElementInterface |
setAppContextObject(Object contextObject)
Define o contexto da aplicação.
|
XMLElementInterface |
setAppObject(Object appObject)
Define o objeto da aplicação associado a este elemento.
|
XMLElementInterface |
setTag(String tag)
Ajusta a tag associada ao elemento.
|
XMLElementInterface |
setValue(double value)
Define o valor do elemento XML a partir de um
double. |
XMLElementInterface |
setValue(String value)
Define o valor do elemento XML a partir de uma
String. |
void |
startTag()
Sinaliza para o elemento que ele acaba de ser criado.
|
void |
write(Writer writer,
String ident)
Escreve o elemento em um stream.
|
void |
writeAttributes(Writer stream)
Escreve os atributos do elemento, na mesma ordem em que foram coletados.
|
void |
writeEndTag(Writer stream)
Escreve a tag de fechamento do elemento, sem identação.
|
void |
writeEndTag(Writer stream,
String ident)
Escreve a tag de fechamento do elemento, usando identação.
|
void |
writeStartTag(Writer stream,
String ident)
Escreve a tag de abertura do elemento.
|
void |
writeStartTagln(Writer stream,
String ident)
Escreve a tag de abertura do elemento, com fim-de-linha.
|
void |
writeValue(Writer stream)
Escreve o valor do elemento.
|
void newCharsEvent(char[] charArray,
int start,
int length)
charArray - os caracteresstart - posição inicial no array de caractereslength - número de caracteres a serem recuperadosXMLElementInterface setValue(String value)
String.value - valorXMLElementInterface setValue(double value)
double.value - valorXMLElementInterface resetValue()
XMLElementInterface appendValue(String value, boolean newLine)
value - - valor como texto (string).newLine - - indica se deve ser anexado um fim-de-linhaboolean hasValue()
true se o o valor do elemento é diferente da string
vaziaboolean isEmpty()
String getStrValue()
String getTag()
XMLElementInterface setTag(String tag)
tag - tag associada ao elementoXMLElementInterface newAttribute(String name, String value)
name - nome do atributovalue - valor do atributoXMLElementInterface newAttribute(String name, int value)
name - nome do atributovalue - valorXMLElementInterface newAttribute(String name, long value)
name - nome do atributovalue - valorXMLElementInterface newAttribute(String name, boolean value)
TRUE ou FALSE
.name - nome do atributovalue - valorXMLElementInterface newAttribute(String name, double value)
double.name - nome do atributovalue - valorXMLElementInterface newAttribute(String name, Enum<?> value)
Enum. O método Enum.toString() é usado para obter o valor a
ser associado ao atributo.name - - nome do atributovalue - - valor de enumeraçãoXMLElementInterface newAttributeList(List<XMLAttribute> newAttrs)
newAttrs - mapa com os novos atributos na forma {nome, valor}void resetAttributeList()
boolean hasAttribute(String name)
name - Nome do atributoString getAttributeStrValue(String name)
name - nome do atributoint getAttributeIntValue(String name)
name - nome do atributodouble getAttributeDoubleValue(String name)
name - nome do atributoboolean getAttributeBooleanValue(String name)
true se o valor do atributo é igual a
"true" (case-insensitive), false caso contrário.name - nome do atributotrue se o valor do atributo é igual à string
"true" (case-insensitive), false caso
contrário.void endTag(List<XMLElementInterface> childrenList)
childrenList - lista com os filhos do elemento em questão, ou uma
lista vazia caso o elemento não possua filhosvoid convertValueFromXML()
@Deprecated String convertTextToXML(String text)
text - texto a ser convertidoList<? extends XMLAttribute> getAttributes()
void write(Writer writer, String ident) throws IOException
writer - stream de saídaident - identaçãoIOException - erro de escrita no streamvoid writeStartTag(Writer stream, String ident) throws IOException
stream - stream de saídaident - identaçãoIOException - erro de escrita no streamvoid writeStartTagln(Writer stream, String ident) throws IOException
stream - stream de saídaident - identaçãoIOException - erro de escrita no streamvoid writeEndTag(Writer stream, String ident) throws IOException
stream - stream de saídaident - identaçãoIOException - erro de escrita no streamvoid writeEndTag(Writer stream) throws IOException
stream - stream de saídaIOException - erro de escrita no streamvoid writeAttributes(Writer stream) throws IOException
stream - stream de saídaIOException - erro de escrita no streamvoid writeValue(Writer stream) throws IOException
stream - stream de saídaIOException - erro de escrita no streamvoid startTag()
float getFloatValue()
float.float associado ao elementoint getIntValue()
int.int associado ao elementolong getLongValue()
long.long associado ao elementodouble getDoubleValue()
float.double associado ao elementoXMLElementInterface setAppContextObject(Object contextObject)
contextObject - objeto representativo de contexto da aplicacao.Object getAppContextObject()
XMLElementInterface setAppObject(Object appObject)
appObject - objeto analogo na aplicacao.Object getAppObject()
null).Copyright © 2016 Tecgraf/PUC-Rio. All rights reserved.