public class XMLWriteInterpreter extends BaseXMLTagInterpreter
Constructor and Description |
---|
XMLWriteInterpreter(java.lang.String name,
MarkupWriter writer)
Initialize the new instance with default values.
|
Modifier and Type | Method and Description |
---|---|
void |
characterData(java.lang.String data)
This method is called whenever character data is received from the parser.
|
protected void |
checkEmptyTag() |
protected void |
finalizeResult()
This method is called just before control is passed back to the controller.
|
protected MarkupWriter |
getMarkupWriter() |
java.lang.Object |
getResult()
Returns the result object, created by this interpreter from the XML data .
|
java.lang.String |
getTagName()
Returns the name of the tag, the interpreter is responsible for.
|
boolean |
isEmptyTag() |
void |
restart(java.lang.String subTagName,
java.lang.Object subResult)
Restarts the receiver after interpretation of a sub tag.
|
void |
setEmptyTag(boolean isEmptyTag) |
boolean |
setLastWasInnerTag() |
void |
setLastWasInnerTag(boolean lastWasInnerTag) |
protected void |
setMarkupWriter(MarkupWriter newValue) |
protected void |
setTagName(java.lang.String newValue) |
void |
start(java.lang.String elementName,
org.xml.sax.Attributes attributes)
Starts the work of the receiver the first time.
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
A new sub tag was found.
|
characters, comment, endCDATA, endDTD, endElement, endEntity, getParseController, invalidSubTagError, requiredAttributeError, setController, setParseController, startCDATA, startDTD, startEntity, trace
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
public XMLWriteInterpreter(java.lang.String name, MarkupWriter writer)
public java.lang.String getTagName()
BaseXMLTagInterpreter
getTagName
in interface XMLTagInterpreter
getTagName
in class BaseXMLTagInterpreter
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
BaseXMLTagInterpreter
startElement
in interface org.xml.sax.ContentHandler
startElement
in class BaseXMLTagInterpreter
org.xml.sax.SAXException
BaseXMLTagInterpreter.restart(String,Object)
,
ContentHandler.startElement(String,String,String,Attributes)
public void start(java.lang.String elementName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
BaseXMLTagInterpreter
start
in interface XMLTagInterpreter
start
in class BaseXMLTagInterpreter
elementName
- The name of the found element. Must be the same as getTagName().attributes
- The attributes defined in the start tag.org.xml.sax.SAXException
- If the element name is wrong or any attribute is invalid.XMLTagInterpreter.getTagName()
public void restart(java.lang.String subTagName, java.lang.Object subResult) throws org.xml.sax.SAXException
BaseXMLTagInterpreter
restart
in interface XMLTagInterpreter
restart
in class BaseXMLTagInterpreter
subTagName
- The name of the sub tag that was completedsubResult
- The resulting object build from the sub tag.org.xml.sax.SAXException
- If the subtag is not allowed here.public java.lang.Object getResult()
getResult
in class BaseXMLTagInterpreter
public void characterData(java.lang.String data)
characterData
in class BaseXMLTagInterpreter
data
- The data received from the parser.ContentHandler.characters(char[],int,int)
protected void checkEmptyTag()
protected void finalizeResult()
finalizeResult
in class BaseXMLTagInterpreter
protected void setTagName(java.lang.String newValue)
protected MarkupWriter getMarkupWriter()
protected void setMarkupWriter(MarkupWriter newValue)
public boolean isEmptyTag()
public void setEmptyTag(boolean isEmptyTag)
public boolean setLastWasInnerTag()
public void setLastWasInnerTag(boolean lastWasInnerTag)