Package eu.bandm.tools.tdom.runtime
Class TypedComment
java.lang.Object
eu.bandm.tools.tdom.runtime.TypedNode
eu.bandm.tools.tdom.runtime.TypedEthereal
eu.bandm.tools.tdom.runtime.TypedComment
Realizes comments in a tdom model instance.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.tdom.runtime.TypedNode
TypedNode.ParseListener<E extends TypedElement<?,?>> -
Constructor Summary
ConstructorsConstructorDescriptionComment with empty contents.TypedComment(String text) Comment with contents. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringPrepares the text for a comment by eliminating the forbidden sequence "--".voiddump(ContentHandler contentHandler, LexicalHandler lexicalHandler) Write this model component to a SAX output stream.voidencode(EncodingOutputStream out, TypedExtension ext) Abstract fall-back method which MUST be overridden and always throws an Exception.getText()Returns the text contents.voidset the text contents.Methods inherited from class eu.bandm.tools.tdom.runtime.TypedEthereal
forAnyExtensionMethods inherited from class eu.bandm.tools.tdom.runtime.TypedNode
asBigDecimal, asBigDecimal, asBigDecimal, asBigDecimal, asBigInteger, asBigInteger, asBigInteger, asBigInteger, asBoolean, asBoolean, asDouble, asDouble, asDouble, asDouble, asFloat, asFloat, asFloat, asFloat, asHexInt, asHexInt, asHexInt, asHexInt, asInt, asInt, asInt, asInt, asLong, asLong, asLong, asLong, asTrimmedString, asTrimmedString, asTrimmedString, asTrimmedString, checkPlus, checkPlus, checkStar, checkStar, checkStrict, encode, encodeOptional, encodePlus, encodePlus, encodeStar, encodeStar, extractEthereals, getLocation, getPCData, setLocation, setLocation, setLocation
-
Constructor Details
-
TypedComment
Comment with contents.- Throws:
IllegalArgumentException- in case of text==null
-
TypedComment
public TypedComment()Comment with empty contents.
-
-
Method Details
-
getText
Returns the text contents.- Returns:
- the text contents.
-
setText
set the text contents.- Throws:
IllegalArgumentException- in case of text==null
-
encode
Description copied from class:TypedNodeAbstract fall-back method which MUST be overridden and always throws an Exception.- Specified by:
encodein classTypedNode- Throws:
IOException
-
dump
public void dump(ContentHandler contentHandler, @Opt LexicalHandler lexicalHandler) throws SAXException Write this model component to a SAX output stream. Please note that in the SAX architecture, PIs are treated by aContentHandler, but Comments by aLexicalHandler, so these two handlers must be supplied as a tandem for a method defined with this abstract class.- Specified by:
dumpin classTypedEthereal- Parameters:
contentHandler- (never null) SAX handler for writing a TypedProcessingInstructionlexicalHandler- SAX handler for writing a Comment. If null, then the comments are silently discarded.- Throws:
SAXException
-
detox
Prepares the text for a comment by eliminating the forbidden sequence "--". The second "minus" will be replaced by a "maplet".
-