|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.interactive_instruments.ShapeChange.TargetHelper.XpathHelper
public class XpathHelper
Nested Class Summary | |
---|---|
static class |
XpathHelper.ExtensionFunctionTemplate
|
Field Summary | |
---|---|
HashMap<String,String> |
namespaces
|
Constructor Summary | |
---|---|
XpathHelper(Options o,
ShapeChangeResult r)
|
Method Summary | |
---|---|
String |
getAndRegisterXmlName(ClassInfo ci)
Auxiliary method to find out the full, namespace adorned name of a class from the the mapping or the model. |
String |
getAndRegisterXmlName(PropertyInfo pi)
Auxiliary method to find out the full, namespace adorned name of a property from the model. |
String |
message(int mnr)
This method returns messages belonging to the XpathHelper object. |
protected String |
messageText(int mnr)
This is the message text provision proper. |
void |
registerNamespace(String xmlns)
This auxiliary method registers a well-known namespace prefix when the namespace occurs the first time |
void |
registerNamespace(String xmlns,
ClassInfo ci)
This special variant of the method above considers the class object to determine the full namespace uri. |
void |
registerNamespace(String xmlns,
String ns)
This method registers a namespace (prefix and namespace proper) when the namespace occurs the first time |
protected XpathConstraintNode |
translateConstraintAttributeToSchematronNode(OclNode.AttributeCallExp attr,
XpathConstraintNode enclosing,
boolean negate)
This method converts AttibuteCallExp objects into intermediary SchematronConstraintsNodes in a first step to realize these in Xpath code. |
protected XpathConstraintNode |
translateConstraintIfExpToSchematronNode(OclNode.IfExp ifex,
XpathConstraintNode enclosing,
boolean negate)
This method will transform an OclNode.IfExp to an intermediary node structure suited for Schematron code generation. |
protected XpathConstraintNode |
translateConstraintIterationToSchematronNode(OclNode.IterationCallExp iter,
XpathConstraintNode enclosing,
boolean negate)
This function treats the implemented IterationCallExp objects in an OCL expression. |
protected XpathConstraintNode |
translateConstraintLiteralToSchematronNode(OclNode.LiteralExp lit,
XpathConstraintNode enclosing,
boolean negate)
This method is supposed to transform the OclNode Literals to an intermediary node structure which is suited for PL/SQL generation. |
protected XpathConstraintNode |
translateConstraintOperationToSchematronNode(OclNode.OperationCallExp oper,
XpathConstraintNode enclosing,
boolean negate)
This function treats the implemented OperationCallExp objects in an OCL expression. |
protected XpathConstraintNode |
translateConstraintToSchematronNode(OclNode ocl,
XpathConstraintNode enclosing,
boolean negate)
This function recursively descends into an OclConstraint following the OclNode structure. |
XpathConstraintNode.XpathFragment |
translateConstraintToXpath(ClassInfo ci,
OclConstraint c)
Take an OCL constraint and translate it into an Xpath expression |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public HashMap<String,String> namespaces
Constructor Detail |
---|
public XpathHelper(Options o, ShapeChangeResult r)
Method Detail |
---|
public void registerNamespace(String xmlns, String ns)
xmlns
- Namespace prefixns
- Namespace properpublic void registerNamespace(String xmlns)
xmlns
- Namespace prefixpublic String getAndRegisterXmlName(PropertyInfo pi)
pi
- PropertyInfo object
public String getAndRegisterXmlName(ClassInfo ci)
Auxiliary method to find out the full, namespace adorned name of a class from the the mapping or the model. As a side effect the method makes the namespace also known to the Schematron schema, appending another <ns> element if necessary.
The method considers the mapping in first priority. If the class turns out to map to a basic type, null is returned instead of a name.
pi
- ClassInfo object
public void registerNamespace(String xmlns, ClassInfo ci)
xmlns
- Namespace prefixci
- ClassInfo object to fetch the namespace uri frompublic XpathConstraintNode.XpathFragment translateConstraintToXpath(ClassInfo ci, OclConstraint c)
ci
- ClassInfo object, which is context to the constraint.c
- OCL constraint. Must be invariant.protected XpathConstraintNode translateConstraintToSchematronNode(OclNode ocl, XpathConstraintNode enclosing, boolean negate)
This function recursively descends into an OclConstraint following the OclNode structure. In doing so it generates an equivalent syntax tree which is more in line with Xpath syntax and its use in the Schematron schema.
ocl
- OclNode of some level, initially called with
OclNode.Expressionenclosing
- Enclosing target construct, may be nullnegate
- Flag to indicate that a logical negation is to be pushed
downwards
protected XpathConstraintNode translateConstraintIterationToSchematronNode(OclNode.IterationCallExp iter, XpathConstraintNode enclosing, boolean negate)
This function treats the implemented IterationCallExp objects in an OCL expression. Doing so it generates intermediate code which is better suited for Schematron generation than the original OCL constructs.
iter
- The IterationCallExp node to be processedenclosing
- Enclosing target constructnegate
- Flag to indicate that a logical negation is to be pushed
downwards
protected XpathConstraintNode translateConstraintOperationToSchematronNode(OclNode.OperationCallExp oper, XpathConstraintNode enclosing, boolean negate)
This function treats the implemented OperationCallExp objects in an OCL expression. Doing so it generates intermediate code which is better suited for Schematron generation than the original OCL constructs.
Particularly, all logical operations are collected in Logic objects of the three flavors AND, OR and XOR, where AND and OR have as many as possible children. NOT is pushed downwards by using De Morgan's rule.
oper
- The OperationCallExp node to be processedenclosing
- Enclosing target constructnegate
- Flag to indicate that a logical negation is to be pushed
downwards
protected XpathConstraintNode translateConstraintAttributeToSchematronNode(OclNode.AttributeCallExp attr, XpathConstraintNode enclosing, boolean negate)
This method converts AttibuteCallExp objects into intermediary SchematronConstraintsNodes in a first step to realize these in Xpath code.
attr
- The AttibuteCallExp objectenclosing
- If an enclosing Logic object is passed, the attribute
must be of type Boolean. Otherwise an error is generated.negate
- A pushed down negation will only be considered if the
attribute is of type Boolean.
protected XpathConstraintNode translateConstraintLiteralToSchematronNode(OclNode.LiteralExp lit, XpathConstraintNode enclosing, boolean negate)
This method is supposed to transform the OclNode Literals to an intermediary node structure which is suited for PL/SQL generation.
lit
- The OclNode.Literal objectenclosing
- If an enclosing Logic object is passed, the literal
must be of type Boolean.negate
- A pushed down negation will only be considered if the
literal is of type Boolean.
protected XpathConstraintNode translateConstraintIfExpToSchematronNode(OclNode.IfExp ifex, XpathConstraintNode enclosing, boolean negate)
This method will transform an OclNode.IfExp to an intermediary node structure suited for Schematron code generation.
ifex
- The OclNode.IfExp objectenclosing
- If an enclosing Logic object is passed, the type of
the IfExp must be Boolean.negate
- A pushed down negation will switch the then and else
parts.
public String message(int mnr)
This method returns messages belonging to the XpathHelper object. The messages are retrieved by their message number. The organization corresponds to the logic in module ShapeChangeResult.
message
in interface MessageSource
mnr
- Message number
protected String messageText(int mnr)
mnr
- Message number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |