public interface IGramarContext
Modifier and Type | Method and Description |
---|---|
void |
addModel(String name,
Document model)
Adds a secondary DOM to the context and associates the Document object at the root of that model
with the given variable name.
|
void |
debug(String message)
Log a debug-level message
|
void |
declareTemplatingExtension(String namespace,
String extensionId)
Associates a platform extension (ID) with a namespace.
|
void |
error(Exception e)
Log an error
|
void |
error(String message)
Log an error message
|
String |
extensionIdForNamespace(String namespace)
Return the extension ID that has been associated with this namespace.
|
void |
free()
Frees up any cached resources
|
IFileStore |
getFileStore()
Answers the current file store
|
IGramar |
getGramar()
Answer the gramar being applied
|
int |
getMaxStatus() |
int |
getModelAccessCount() |
IGramar |
getPattern() |
IGramarPlatform |
getPlatform()
Answers the PatternPlatform from which all extensions can be eventually located
|
Document |
getPrimaryModel()
Answer the model specified when the context was originally constructed
|
DefinedTag |
getTagDef(String namespace,
String tagName)
Answers the tag definition with the given name from the extension associated with the given namespace
|
ITagHandler |
getTagHandler(String namespace,
String tagName)
Answers the tag handler with the given name from the extension associated with the given namespace.
|
Object |
getVariable(String variableName)
Answers the value associated with the variable name
|
XPath |
getXPath() |
XPathFunction |
getXPathFunction(String namespace,
String name,
int arity)
Answers the xpath function that best matches the given name and arity from the extension associated
with the given namespace
|
void |
info(String message)
Log an informational message
|
boolean |
isExtensionDefined(String extensionId) |
String |
resolveExpressions(String pattern)
Replace substrings delimited by curly brackets with the results of evaluating those
substrings as xpath expressions.
|
boolean |
resolveToBoolean(String expression)
Resolve the given XPath expression to a boolean value
|
boolean |
resolveToBoolean(String expression,
Node sourceNode)
Resolve the given XPath expression from the sourceNode to a boolean value
|
Node |
resolveToNode(String expression)
Resolve the given XPath expression to a single node
|
Node |
resolveToNode(String expression,
Node sourceNode)
Resolve the given XPath expression from the sourceNode to a single node
|
Node[] |
resolveToNodes(String expression)
Resolve the given XPath expression to an array of nodes
|
Node[] |
resolveToNodes(String expression,
Node sourceNode)
Resolve the given XPath expression from the sourceNode to an array of nodes
|
double |
resolveToNumber(String expression)
Resolve the given XPath expression to a numeric (double) value
|
double |
resolveToNumber(String expression,
Node sourceNode)
Resolve the given XPath expression from the sourceNode to a numeric (double) value
|
Object |
resolveToObject(String expression)
Resolve the given XPath expression to a value and return the correct type of result.
|
Object |
resolveToObject(String expression,
Node sourceNode)
Resolve the given XPath expression from the source node to a value and return the correct type of result.
|
String |
resolveToString(String expression)
Resolve the given XPath expression to a single string
|
String |
resolveToString(String expression,
Node sourceNode)
Resolve the given XPath expression from the sourceNode to a single string
|
void |
setAttribute(String nodeExpression,
String attrName,
String value)
Sets the attribute on the node (obtained by resolving the nodeExpression) to
the specified value
|
void |
setFileStore(IFileStore fileStore)
Sets the current file store
|
void |
setGramar(IGramar pattern) |
void |
setVariable(String variableName,
Object value)
Sets associates the value with the variable name.
|
void |
unsetVariable(String variableName)
Removes the association between the variable name and its value.
|
void |
warning(Exception e)
Log a warning
|
void |
warning(String message)
Log a warning message
|
void setVariable(String variableName, Object value)
void unsetVariable(String variableName)
Object getVariable(String variableName)
void setAttribute(String nodeExpression, String attrName, String value) throws XPathExpressionException
XPathExpressionException
String resolveExpressions(String pattern) throws XPathExpressionException
XPathExpressionException
String resolveToString(String expression) throws XPathExpressionException
XPathExpressionException
String resolveToString(String expression, Node sourceNode) throws XPathExpressionException
XPathExpressionException
boolean resolveToBoolean(String expression) throws XPathExpressionException
XPathExpressionException
boolean resolveToBoolean(String expression, Node sourceNode) throws XPathExpressionException
XPathExpressionException
double resolveToNumber(String expression) throws XPathExpressionException
XPathExpressionException
double resolveToNumber(String expression, Node sourceNode) throws XPathExpressionException
XPathExpressionException
Object resolveToObject(String expression) throws XPathExpressionException
XPathExpressionException
Object resolveToObject(String expression, Node sourceNode) throws XPathExpressionException
XPathExpressionException
Node resolveToNode(String expression) throws XPathExpressionException
XPathExpressionException
Node resolveToNode(String expression, Node sourceNode) throws XPathExpressionException
XPathExpressionException
Node[] resolveToNodes(String expression) throws XPathExpressionException
XPathExpressionException
Node[] resolveToNodes(String expression, Node sourceNode) throws XPathExpressionException
XPathExpressionException
void addModel(String name, Document model)
Document getPrimaryModel()
IGramar getGramar()
void declareTemplatingExtension(String namespace, String extensionId)
String extensionIdForNamespace(String namespace) throws NamespaceNotDefinedException
NamespaceNotDefinedException
IFileStore getFileStore()
void setFileStore(IFileStore fileStore)
IGramarPlatform getPlatform()
DefinedTag getTagDef(String namespace, String tagName) throws GramarException
GramarException
ITagHandler getTagHandler(String namespace, String tagName) throws GramarException
GramarException
XPathFunction getXPathFunction(String namespace, String name, int arity) throws GramarException
GramarException
boolean isExtensionDefined(String extensionId)
void setGramar(IGramar pattern)
IGramar getPattern()
void warning(Exception e)
void error(Exception e)
XPath getXPath()
int getModelAccessCount()
void debug(String message)
message
- - the text to be writtenvoid info(String message)
message
- - the text to be writtenvoid warning(String message)
message
- - the text to be writtenvoid error(String message)
message
- - the text to be writtenvoid free()
int getMaxStatus()
Copyright © 2015. All rights reserved.