Class AbstractParseState
java.lang.Object
org.eclipse.birt.core.framework.parser.AbstractParseState
- Direct Known Subclasses:
ParseState
Abstract parse state for the
XMLParserHandler class. Derived
classes create parse states based on this class.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringSAX context string.protected StringThe name of the element being parsed.protected StringBufferAccumulates any text that appears within the element tags. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidend()Called when the element for this state is ending.voidendElement(AbstractParseState state) Called when a child element is ending.protected StringgetAttrib(Attributes attrs, String attrName) Parse a string value.abstract XMLParserHandlerReturns the parser handler.jumpTo()Jumps to the specified state that the current state needs to go.voidparseAttrs(Attributes attrs) Called to parse attributes.voidsetElementName(String name) Sets the element name.startElement(String tagName) Start a new tag.
-
Field Details
-
context
SAX context string. -
elementName
The name of the element being parsed. -
text
Accumulates any text that appears within the element tags.
-
-
Constructor Details
-
AbstractParseState
public AbstractParseState()
-
-
Method Details
-
setElementName
Sets the element name.- Parameters:
name- the name of the element.
-
jumpTo
Jumps to the specified state that the current state needs to go.- Returns:
- the other state.
-
parseAttrs
Called to parse attributes. This is the first method called after the state is created.Returns the value of attribute name.- Parameters:
attrs- the SAX attributes object- Throws:
XMLParserException- if any parse exception- See Also:
-
startElement
Start a new tag. Derived classes override this to create a state to handle the element. Call this method to issue an error for, and ignore, any unrecognized tags.- Parameters:
tagName- the name of the starting element- Returns:
- the state to parse the given tag
- See Also:
-
getHandler
Returns the parser handler. Required to be implemented by derived states. States will implement this differently depending on whether the state is a normal or inner class.- Returns:
- the XML parser handler
-
endElement
Called when a child element is ending.- Parameters:
state- the child state that is ending
-
end
Called when the element for this state is ending.- Throws:
SAXException- if the SAX exception is encountered.- See Also:
-
getAttrib
Parse a string value. Normalizes the string: blank strings are converted to a null string.- Parameters:
attrs- the SAX attributes objectattrName- the name of the attribute to parse- Returns:
- the parsed string
-