|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.schema.impl.tools.ExpFinder
public final class ExpFinder
This class is capable of returning (for a particular element node) the MSV expression, that generates its children.
Constructor Summary | |
---|---|
ExpFinder(SchemaImpl schema)
Constructs the class, which will be working with this grammar. |
Method Summary | |
---|---|
com.sun.msv.grammar.ElementExp |
getExpression(Element e,
ExpFinderLevel level)
Returns the ElementExp expression, that may validate
element e . |
Set<com.sun.msv.grammar.ElementExp> |
getExpressionSet(Element e,
ExpFinderLevel level,
boolean validOnly)
Returns set of ElementExp expression, that can be used to
generate element e . |
Set<com.sun.msv.grammar.ElementExp> |
getParents(com.sun.msv.grammar.ElementExp exp)
Returns all possible parent element expressions of given element expression. |
Set<com.sun.msv.grammar.ElementExp> |
getParents(Set<com.sun.msv.grammar.ElementExp> elementExps)
Returns all possible parent element expressions of all given element expressions. |
boolean |
isContextFree(String localName)
Checks if there is more than one ElementExp instance, that
can generate element with specified local name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpFinder(SchemaImpl schema)
schema
- SchemaImpl instance.Method Detail |
---|
public com.sun.msv.grammar.ElementExp getExpression(Element e, ExpFinderLevel level)
ElementExp
expression, that may validate
element e
. The function acts as if the
validOnly==false
.
e
- The element.level
- level of test. For details see getExpressionSet
.
IllegalStateException
- thrown when there are multiple rules on
this level
DocumentValidityException
- if no expression is suitable for given
element.public boolean isContextFree(String localName) throws DocumentValidityException
ElementExp
instance, that
can generate element with specified local name.
localName
- Element's local name.
DocumentValidityException
- thrown if no elementexp exists for such
local name.public Set<com.sun.msv.grammar.ElementExp> getExpressionSet(Element e, ExpFinderLevel level, boolean validOnly)
Returns set of ElementExp
expression, that can be used to
generate element e
. Level parameter describes depth of
test for each result, as described in the LEVEL_
constants.
Parameter validOnly
controls the real validness of rules.
If false is specified, and exactly one expression had been found, then
element can have only this rule, and such is returned. That means that
higher level tests aren't performed, even when required by the
level
parameter. Thus, if lower test returned one
expression, this is returned without validity checks. This is ideal, when
we are sure that document is valid. On the other side, if true is given,
then all required tests are performed, regardless of result.
Warning: even when most restrictive tests are performed, we still can't be sure that returned expressions are really used to generate given element. More precisely, we can be sure that result is correct, when one of following is true:
validOnly
parameter's value
is irrelevant and may be set to false for faster execution.
e
- The element.level
- describes level of tests, that will be applied on result
rules, if needed.validOnly
- if true, then only really valid expressions are
returned. If false, function may execute more faster.
public Set<com.sun.msv.grammar.ElementExp> getParents(Set<com.sun.msv.grammar.ElementExp> elementExps)
elementExps
- set of element expressions.
ElementExp
s of all given elements.public Set<com.sun.msv.grammar.ElementExp> getParents(com.sun.msv.grammar.ElementExp exp)
exp
- element expression.
ElementExp
s of given
element.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |