tecgraf.javautils.xml
Class XMLComment

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.XMLComment
All Implemented Interfaces:
XMLElementInterface

public class XMLComment
extends XMLNullDataElement

Comentários XML. Esta classe nunca é instanciada pelo handler, pois não há evento (pelo menos no JAXP 1.1) associado a comentários, mas pode ser instanciada a partir da aplicação. O texto do comentário deve ser associado ao valor do elemento.

Author:
Andre Oliveira da Costa

Constructor Summary
XMLComment(String text)
          Comentários são criados apenas a partir da aplicação -- SAX não gera eventos para comentários.
 
Method Summary
 void write(Writer stream, String ident)
          Escreve o comentário, com a identação corrente.
static void write(Writer stream, String ident, String text)
          Escreve o comentário, com a identação corrente.
 
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, getStrValue, getTag, hasAttribute, hasValue, isEmpty, newAttribute, newAttribute, newAttribute, newAttribute, newAttribute, newAttribute, newAttributeList, newCharsEvent, resetAttributeList, resetValue, setAppContextObject, setAppObject, setTag, setValue, setValue, startTag, writeAttributes, writeAttributes, writeEndTag, writeEndTag, writeStartTag, writeStartTagln, writeValue, xmlEncode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLComment

public XMLComment(String text)
Comentários são criados apenas a partir da aplicação -- SAX não gera eventos para comentários. Este construtor não recebe a tag, a exemplo dos demais elementos, mas sim o valor (texto) do comentário.

Parameters:
text - texto associado ao comentário
Method Detail

write

public void write(Writer stream,
                  String ident)
           throws IOException
Escreve o comentário, com a identação corrente. O comentário será escrito em uma única linha.

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

write

public static void write(Writer stream,
                         String ident,
                         String text)
                  throws IOException
Escreve o comentário, com a identação corrente. O comentário será escrito em uma única linha.

Parameters:
stream - stream de saída
ident - identação
text - texto do comentário
Throws:
IOException - se houver problemas na escrita


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