Class TemplateParser
- java.lang.Object
-
- gov.nist.secauto.decima.xml.templating.document.post.template.TemplateParser
-
public class TemplateParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEMPLATE_LOCAL_NAMEstatic org.jdom2.NamespaceTEMPLATE_NAMESPACE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildAddAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)protected voidbuildDeleteAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)protected voidbuildInsertChildAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)protected voidbuildInsertSiblingAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)protected voidbuildModifyAttributeAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)protected voidbuildReplaceAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)protected TemplateProcessorBuilderbuildTemplate(org.jdom2.Element templateElement, URL contextSystemId)static TemplateParsergetInstance()protected org.jdom2.xpath.XPathFactorygetXpathfactory()TemplateProcessorparse(gov.nist.secauto.decima.xml.document.XMLDocument template)TemplateProcessorparse(InputStream is, URL contextSystemId)Parse an XML document as a Decima template.TemplateProcessorparse(org.jdom2.Element templateElement, URL contextSystemId)Parse an XML element as a Decima template.
-
-
-
Field Detail
-
TEMPLATE_NAMESPACE
public static final org.jdom2.Namespace TEMPLATE_NAMESPACE
-
TEMPLATE_LOCAL_NAME
public static final String TEMPLATE_LOCAL_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static TemplateParser getInstance()
-
getXpathfactory
protected org.jdom2.xpath.XPathFactory getXpathfactory()
-
parse
public TemplateProcessor parse(gov.nist.secauto.decima.xml.document.XMLDocument template) throws TemplateParserException
- Throws:
TemplateParserException
-
parse
public TemplateProcessor parse(org.jdom2.Element templateElement, URL contextSystemId) throws TemplateParserException
Parse an XML element as a Decima template.- Parameters:
templateElement- the element to parsecontextSystemId- the systemId of the containing document- Returns:
- a new template processor based on the element's contents
- Throws:
TemplateParserException- if an error occurred while parsing the element's contents
-
parse
public TemplateProcessor parse(InputStream is, URL contextSystemId) throws TemplateParserException
Parse an XML document as a Decima template.- Parameters:
is- the stream to read the document fromcontextSystemId- the systemId of the document being read- Returns:
- a new template processor based on the XML contents
- Throws:
TemplateParserException- if an error occurred while parsing the XML contents
-
buildTemplate
protected TemplateProcessorBuilder buildTemplate(org.jdom2.Element templateElement, URL contextSystemId) throws TemplateParserException
- Throws:
TemplateParserException
-
buildModifyAttributeAction
protected void buildModifyAttributeAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)
-
buildInsertSiblingAction
protected void buildInsertSiblingAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement) throws TemplateParserException
- Throws:
TemplateParserException
-
buildInsertChildAction
protected void buildInsertChildAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement) throws TemplateParserException
- Throws:
TemplateParserException
-
buildDeleteAction
protected void buildDeleteAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)
-
buildAddAction
protected void buildAddAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement)
-
buildReplaceAction
protected void buildReplaceAction(TemplateProcessorBuilder builder, org.jdom2.Element actionElement) throws TemplateParserException
- Throws:
TemplateParserException
-
-