java.lang.Object | |||
↳ | org.xml.sax.helpers.DefaultHandler | ||
↳ | com.microstrategy.utils.xml.AbstractHandler | ||
↳ | com.microstrategy.web.transform.MSTRLayoutParser.ParserContentHandler |
This is the default implementation of the ContentHandler to use parse the layout XML.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ParserContentHandler(String layoutLocation)
The constructor for this class.
| |||||||||||
ParserContentHandler(String layoutLocation, LayoutSource layoutSource, LayoutParser layoutParser)
The constructor for this class.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
characters(char[] ch, int start, int length)
ContentHandler method to indicate that text content has been identified.
| ||||||||||
void |
doEndElement(String namespaceURI, String localName, String qName)
AbstractHandler method that identifies the closing of a tag.
| ||||||||||
void |
doStartElement(String namespaceURI, String localName, String qName, Attributes atts)
AbstracHandler method to process the start of an element.
| ||||||||||
void |
endDocument()
ContentHandler method to indicate the end of the document.
| ||||||||||
String |
generateErrorMessage(String msg)
Generate a standard error message which includes the layout location (the
source of the layout), the line number and the innermost enclosing element.
| ||||||||||
LayoutTag |
getLayoutTag()
The generated
LayoutTag object constructed during parsing. | ||||||||||
LayoutParser.MessageListener |
getMessageListener()
Returns the
LayoutParser.MessageListener object used by this
parser instance. | ||||||||||
void |
setDocumentLocator(Locator locator)
ContentHandler method that records the current Locator for this document.
| ||||||||||
void |
setMessageListener(LayoutParser.MessageListener msgListener)
Set the
LayoutParser.MessageListener object to use with this
parser instance. | ||||||||||
void |
startDocument()
ContentHandler method that records the start of the XML document.
| ||||||||||
void |
validationError()
Increments the number of validation errors encountered in this parsing.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StringBuffer |
generateErrorMessagePrefix()
Generate the prefix of a diagnostic message.
| ||||||||||
String |
generateInternalError(String msg)
Generate an error message to reflect an internal parser
error.
| ||||||||||
void |
initParserDataStructures()
Initialize any parser specific data structures.
| ||||||||||
boolean |
isVersionValid(String version)
This checks whether the supplied version is valid for this
parser implementation.
| ||||||||||
void |
releaseParserDataStructures()
Release any parser specific data structures.
| ||||||||||
void |
sendErrorMsg(String msg)
Send a message to the
LayoutParser.MessageListener object's
error(String) method. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
The constructor for this class. It stores away the layout location
so that it can a) use it for error and warning messages and b)
store it in the generated LayoutTag
object.
The constructor for this class. It stores away the layout location
so that it can a) use it for error and warning messages and b)
store it in the generated LayoutTag
object. It also stores the
layoutSource and layoutParser information so the include tag can use them
to load the external layout files.
ContentHandler method to indicate that text content has been identified.
This implementation adds it to the current tag (via addTextChild(String)
.
ch | The characters. |
---|---|
start | The start position in the character array. |
length | The number of characters to use from the character array. |
SAXException |
---|
AbstractHandler method that identifies the closing of a tag. The current implementation pops the current tag off the stack.
SAXException |
---|
AbstracHandler method to process the start of an element. If this is the root
element, the version number is checked and if successful, the LayoutTag
is recorded. Otherwise, a new generic tag is created (based on the localName
of the element). Any attributes associated with the tag are added to the Tag
object. The line number of the tag is recorded also in the Tag
and the current
Tag
is pushed on the stack (making it the new "current" tag.
SAXException |
---|
ContentHandler method to indicate the end of the document. This implementation
checks that there are no tags still open. If there were validation errors, then
a SAXException is raised. Regardless of whether either of these occur, a call is
made to release all parser data structures (releaseParserDataStructures()
).
SAXException |
---|
Generate a standard error message which includes the layout location (the source of the layout), the line number and the innermost enclosing element.
msg | The message to include in the standard message. |
---|
Returns the LayoutParser.MessageListener
object used by this
parser instance.
LayoutParser.MessageListener
object.
ContentHandler method that records the current Locator for this document. It is used
by the generateErrorMessage(String)
method to include line numbers.
Set the LayoutParser.MessageListener
object to use with this
parser instance.
msgListener | The LayoutParser.MessageListener object.
|
---|
ContentHandler method that records the start of the XML document. This implementation
calls the initParserDataStructures()
method to initialize any data structures.
SAXException |
---|
Increments the number of validation errors encountered in this parsing.
Generate the prefix of a diagnostic message. The current message begins with context information such as the layout location (if present), line number information, and current enclosing tag.
Generate an error message to reflect an internal parser error.
msg | The message to send. |
---|
Initialize any parser specific data structures.
This checks whether the supplied version is valid for this parser implementation.
version | The version strinig on the layout tag. |
---|
Release any parser specific data structures.
Send a message to the LayoutParser.MessageListener
object's
error(String)
method.
msg | The message to send. |
---|