Package org.simpleframework.xml.core
Class ExpressionBuilder
java.lang.Object
org.simpleframework.xml.core.ExpressionBuilder
The
ExpressionBuilder
object is used build and cache
path expressions. The expressions provided by this must be valid
XPath expressions. However, only a subset of the full XPath
syntax is supported. Because these expressions require parsing
they are cached internally. This improves performance as if a
path expression is declared several times it is parsed once.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExpressionBuilder
(Detail detail, Support support) Constructor for theExpressionBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionThis is used to create anExpression
from the provided path.private Expression
This is used to create anExpression
from the provided path.
-
Field Details
-
cache
This is the cache of path expressions previously built. -
format
This is the format used to style the path segments. -
type
This is the type the expressions are being built for.
-
-
Constructor Details
-
ExpressionBuilder
Constructor for theExpressionBuilder
. This is used to create a builder to cache frequently requested XPath expressions. Such caching improves the overall performance.- Parameters:
detail
- the details for the the class with expressionssupport
- this contains various support functions
-
-
Method Details
-
build
This is used to create anExpression
from the provided path. If the path does not conform to the syntax supported then an exception is thrown to indicate the error. If the path was requested before, a cached instance is used.- Parameters:
path
- this is the XPath expression to be parsed- Returns:
- this returns the resulting expression object
- Throws:
Exception
-
create
This is used to create anExpression
from the provided path. If the path does not conform to the syntax supported then an exception is thrown to indicate the error.- Parameters:
path
- this is the XPath expression to be parsed- Returns:
- this returns the resulting expression object
- Throws:
Exception
-