org.objectweb.kilim.repository
Class TemplateDescriptionParser
java.lang.Object
org.objectweb.kilim.repository.TemplateDescriptionParser
- public class TemplateDescriptionParser
- extends java.lang.Object
- Author:
- dutoo, horn
Kilim xml format parser. Uses a JAXP SAXParser. Validates the kilim xml DTD
(which is to be found in a ResourceLoader) and logs its error and warnings
to a ParserErrorHandler.
Constructor Summary |
TemplateDescriptionParser(boolean isValidating)
Creates a new TemplateDescriptionParser using the JAXP SAX factory's new
default parser, a new BasicErrorHandler and loads DTDs from a new
ClassLoaderResourceLoader. |
TemplateDescriptionParser(javax.xml.parsers.SAXParser aSaxParser,
ParserErrorHandler anErrorHandler,
ResourceLoader aResourceLoader)
Creates a new TemplateDescriptionParser using the given custom template SAX parser. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLASSPATH_URI_PREFIX
private static final java.lang.String CLASSPATH_URI_PREFIX
- See Also:
- Constant Field Values
SUPER_ID
private static final java.lang.String SUPER_ID
- See Also:
- Constant Field Values
resourceLoader
private ResourceLoader resourceLoader
saxParser
private javax.xml.parsers.SAXParser saxParser
errorHandler
private ParserErrorHandler errorHandler
currentTemplateName
private java.lang.String currentTemplateName
TemplateDescriptionParser
public TemplateDescriptionParser(boolean isValidating)
- Creates a new TemplateDescriptionParser using the JAXP SAX factory's new
default parser, a new BasicErrorHandler and loads DTDs from a new
ClassLoaderResourceLoader.
May log SAXException on parser creation exception
and. ParserConfigurationException if DTD validation is impossible
- Parameters:
isValidating
- if true, requires the parsed xml template to be validated
against the kilim_template.dtd, which has therefore to be in the classpath.
NB: the template parser behaviour on parsing error is undetermined if there is
no template DTD validation.
TemplateDescriptionParser
public TemplateDescriptionParser(javax.xml.parsers.SAXParser aSaxParser,
ParserErrorHandler anErrorHandler,
ResourceLoader aResourceLoader)
- Creates a new TemplateDescriptionParser using the given custom template SAX parser.
- Parameters:
aSaxParser
- the custom kilim xml format parseranErrorHandler
- to be used for model & parsing errors handling delegationaResourceLoader
- where the DTDs are to be found
NB: the template parser behaviour on parsing error is undetermined if the given SAX
parser doesn't validate template DTD.
importTemplateDescription
public TemplateDescription importTemplateDescription(java.io.InputStream is,
ResourceMapping aParsingResult,
java.lang.String aName)
- Method importTemplateDescription.
- Parameters:
is
- kilim xml format dataaParsingResult
- holds the template dependancies & naming to be solvedaName
- is the template resource name.
- Returns:
- the parsed Template (its template naming is not resolved yet)