com.webobjects.appserver.parser.woml
Class WOMLTemplateParser
java.lang.Object
com.webobjects.appserver.parser.WOComponentTemplateParser
com.webobjects.appserver.parser.woml.WOMLTemplateParser
- All Implemented Interfaces:
- ContentHandler, LexicalHandler
public class WOMLTemplateParser
- extends WOComponentTemplateParser
- implements ContentHandler, LexicalHandler
Method Summary |
protected void |
addChildElement(WOElement child,
NSMutableArray<WOElement> elements)
|
protected void |
appendEscapedText(CharSequence sequence,
StringBuilder buffer)
|
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
protected void |
endCurrentTextNode()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
endEntity(String name)
|
void |
endPrefixMapping(String prefix)
|
protected void |
escapeInnerData(CharSequence sequence,
String prefix,
String suffix,
StringBuilder buffer)
|
static String |
escapeRegex(String s)
|
protected int |
getCurrentColumnNumber()
|
protected int |
getCurrentLineNumber()
|
protected WOMLParentNode |
getCurrentNode()
|
protected WOMLPosition |
getCurrentPosition()
|
DTDHandler |
getDTDHandler()
|
EntityResolver |
getEntityResolver()
|
ErrorHandler |
getErrorHandler()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
static boolean |
isCombinedTemplate(com.webobjects.appserver._private.WOComponentDefinition definition)
|
WOElement |
parse()
|
protected String |
pathForComponentDef(com.webobjects.appserver._private.WOComponentDefinition componentDef)
Returns the path string for the component definition given. |
protected WOMLParentNode |
popNode()
|
protected String |
preprocess(String templateString)
This is unclean. |
protected WOElement |
process(String theTemplateString)
|
void |
processingInstruction(String target,
String data)
|
protected void |
pushNode(WOMLParentNode node)
|
void |
setDocumentLocator(Locator locator)
|
void |
setDTDHandler(DTDHandler dtdHandler)
|
void |
setEntityResolver(EntityResolver entityResolver)
|
void |
setErrorHandler(ErrorHandler handler)
|
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String systemId)
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
static WOElement |
templateWithString(String referenceName,
String templateString,
NSArray<String> languages,
WOAssociationFactory associationFactory,
WOMLNamespaceProvider namespaceProvider)
|
protected void |
updateStartPosition()
|
Methods inherited from class com.webobjects.appserver.parser.WOComponentTemplateParser |
associationFactory, declarationString, htmlString, languages, namespaceProvider, referenceName, setDeclarationString, setHtmlString, setLanguages, setWOHTMLTemplateParserClassName, shouldThrowException, templateWithHTMLAndDeclaration, templateWithHTMLAndDeclaration, toString |
WOMLTemplateParser
public WOMLTemplateParser(String referenceName,
String HTMLString,
String declarationString,
NSArray<String> languages,
WOAssociationFactory associationFactory,
WOMLNamespaceProvider namespaceProvider)
templateWithString
public static WOElement templateWithString(String referenceName,
String templateString,
NSArray<String> languages,
WOAssociationFactory associationFactory,
WOMLNamespaceProvider namespaceProvider)
throws WODeclarationFormatException,
WOHTMLFormatException,
ClassNotFoundException
- Throws:
WODeclarationFormatException
WOHTMLFormatException
ClassNotFoundException
escapeRegex
public static String escapeRegex(String s)
isCombinedTemplate
public static boolean isCombinedTemplate(com.webobjects.appserver._private.WOComponentDefinition definition)
pathForComponentDef
protected String pathForComponentDef(com.webobjects.appserver._private.WOComponentDefinition componentDef)
- Returns the path string for the component definition given.
- Parameters:
componentDef
-
- Returns:
getCurrentNode
protected WOMLParentNode getCurrentNode()
popNode
protected WOMLParentNode popNode()
pushNode
protected void pushNode(WOMLParentNode node)
escapeInnerData
protected void escapeInnerData(CharSequence sequence,
String prefix,
String suffix,
StringBuilder buffer)
appendEscapedText
protected void appendEscapedText(CharSequence sequence,
StringBuilder buffer)
preprocess
protected String preprocess(String templateString)
- This is unclean. This splits CDATA and comment sections into bits
that have embedded elements. This also translates any non-comment and
non-CDATA content ampersands to XML escape sequences (& -> &).
- Parameters:
templateString
-
- Returns:
process
protected WOElement process(String theTemplateString)
throws WOMLTemplateParserException
- Throws:
WOMLTemplateParserException
getCurrentLineNumber
protected int getCurrentLineNumber()
getCurrentColumnNumber
protected int getCurrentColumnNumber()
getCurrentPosition
protected WOMLPosition getCurrentPosition()
updateStartPosition
protected void updateStartPosition()
endCurrentTextNode
protected void endCurrentTextNode()
addChildElement
protected void addChildElement(WOElement child,
NSMutableArray<WOElement> elements)
getErrorHandler
public ErrorHandler getErrorHandler()
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
getEntityResolver
public EntityResolver getEntityResolver()
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
getDTDHandler
public DTDHandler getDTDHandler()
setDTDHandler
public void setDTDHandler(DTDHandler dtdHandler)
parse
public WOElement parse()
throws ClassNotFoundException,
WODeclarationFormatException,
WOHTMLFormatException
- Specified by:
parse
in class WOComponentTemplateParser
- Returns:
- Parsed component
- Throws:
ClassNotFoundException
WODeclarationFormatException
WOHTMLFormatException
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interface ContentHandler
startDocument
public void startDocument()
throws SAXException
- Specified by:
startDocument
in interface ContentHandler
- Throws:
SAXException
endDocument
public void endDocument()
throws SAXException
- Specified by:
endDocument
in interface ContentHandler
- Throws:
SAXException
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
- Specified by:
startPrefixMapping
in interface ContentHandler
- Throws:
SAXException
endPrefixMapping
public void endPrefixMapping(String prefix)
throws SAXException
- Specified by:
endPrefixMapping
in interface ContentHandler
- Throws:
SAXException
processingInstruction
public void processingInstruction(String target,
String data)
throws SAXException
- Specified by:
processingInstruction
in interface ContentHandler
- Throws:
SAXException
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Specified by:
startElement
in interface ContentHandler
- Throws:
SAXException
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
- Specified by:
endElement
in interface ContentHandler
- Throws:
SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
- Specified by:
characters
in interface ContentHandler
- Throws:
SAXException
ignorableWhitespace
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
- Specified by:
ignorableWhitespace
in interface ContentHandler
- Throws:
SAXException
skippedEntity
public void skippedEntity(String name)
throws SAXException
- Specified by:
skippedEntity
in interface ContentHandler
- Throws:
SAXException
comment
public void comment(char[] ch,
int start,
int length)
throws SAXException
- Specified by:
comment
in interface LexicalHandler
- Throws:
SAXException
startCDATA
public void startCDATA()
throws SAXException
- Specified by:
startCDATA
in interface LexicalHandler
- Throws:
SAXException
endCDATA
public void endCDATA()
throws SAXException
- Specified by:
endCDATA
in interface LexicalHandler
- Throws:
SAXException
startDTD
public void startDTD(String name,
String publicId,
String systemId)
throws SAXException
- Specified by:
startDTD
in interface LexicalHandler
- Throws:
SAXException
endDTD
public void endDTD()
throws SAXException
- Specified by:
endDTD
in interface LexicalHandler
- Throws:
SAXException
startEntity
public void startEntity(String name)
throws SAXException
- Specified by:
startEntity
in interface LexicalHandler
- Throws:
SAXException
endEntity
public void endEntity(String name)
throws SAXException
- Specified by:
endEntity
in interface LexicalHandler
- Throws:
SAXException
Copyright © 2000-2007 Apple Inc.