tecgraf.javautils.xml
Class XMLEmptyElement

java.lang.Object
  extended by tecgraf.javautils.xml.XMLElement
      extended by tecgraf.javautils.xml.XMLDataElement
          extended by tecgraf.javautils.xml.XMLNullDataElement
              extended by tecgraf.javautils.xml.XMLEmptyElement
All Implemented Interfaces:
XMLElementInterface

public class XMLEmptyElement
extends XMLNullDataElement

Elemento XML vazio (<tag attr1="val1" attr2="val2" ... />).

Author:
Andre Oliveira da Costa

Constructor Summary
XMLEmptyElement()
           
 
Method Summary
 String getStrValue()
          Retorno do texto interno.
 void write(Writer stream, String ident)
          Escreve o elemento corrente (o que significa, no caso de elementos vazios, escrever apenas a tag de abertura).
 void writeEndTag(Writer stream, String ident)
          (Não) escreve a tag de fechamento.
 void writeStartTag(Writer stream, String ident)
          Escreve a tag de abertura, no formato compatível com elementos vazios.
 void writeStartTagln(Writer stream, String ident)
          Escreve a tag de abertura, no formato compatível com elementos vazios, e adiciona um fim-de-linha.
 
Methods inherited from class tecgraf.javautils.xml.XMLNullDataElement
endTag
 
Methods inherited from class tecgraf.javautils.xml.XMLDataElement
write, write, write, writeEndTag
 
Methods inherited from class tecgraf.javautils.xml.XMLElement
appendValue, convertTextToXML, convertValueFromXML, getAppContextObject, getAppObject, getAttributeBooleanValue, getAttributeDoubleValue, getAttributeIntValue, getAttributes, getAttributeStrValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getStrValue, getTag, hasAttribute, hasValue, isEmpty, newAttribute, newAttribute, newAttribute, newAttribute, newAttribute, newAttribute, newAttributeList, newCharsEvent, resetAttributeList, resetValue, setAppContextObject, setAppObject, setTag, setValue, setValue, startTag, writeAttributes, writeAttributes, writeEndTag, writeValue, xmlEncode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLEmptyElement

public XMLEmptyElement()
Method Detail

writeEndTag

public final void writeEndTag(Writer stream,
                              String ident)
                       throws IOException
(Não) escreve a tag de fechamento.

Specified by:
writeEndTag in interface XMLElementInterface
Overrides:
writeEndTag in class XMLElement
Parameters:
stream - stream de saida.
ident - identação
Throws:
IOException - se houver algum erro de escrita

writeStartTag

public final void writeStartTag(Writer stream,
                                String ident)
                         throws IOException
Escreve a tag de abertura, no formato compatível com elementos vazios.

Specified by:
writeStartTag in interface XMLElementInterface
Overrides:
writeStartTag in class XMLElement
Parameters:
stream - stream de saida.
ident - identação
Throws:
IOException - se houver algum erro de escrita

writeStartTagln

public final void writeStartTagln(Writer stream,
                                  String ident)
                           throws IOException
Escreve a tag de abertura, no formato compatível com elementos vazios, e adiciona um fim-de-linha.

Specified by:
writeStartTagln in interface XMLElementInterface
Overrides:
writeStartTagln in class XMLElement
Parameters:
stream - stream de saida.
ident - identação
Throws:
IOException - se houver algum erro de escrita

getStrValue

public final String getStrValue()
Retorno do texto interno.

Specified by:
getStrValue in interface XMLElementInterface
Overrides:
getStrValue in class XMLElement
Returns:
o valor do elemento (como texto) ou uma string vazia
See Also:
XMLElementInterface.getStrValue()

write

public void write(Writer stream,
                  String ident)
           throws IOException
Escreve o elemento corrente (o que significa, no caso de elementos vazios, escrever apenas a tag de abertura).

Specified by:
write in interface XMLElementInterface
Overrides:
write in class XMLDataElement
Parameters:
stream - stream de saida.
ident - identação
Throws:
IOException - se houver problemas na escrita


Copyright © 2014 Tecgraf/PUC-Rio. All rights reserved.