|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtualweaver.xotics.datamodel.xpath.XpContext
XPath dynamic execution context, containing various tools and infos useful to process XPath requests.
Constructor Summary | |
XpContext(com.virtualweaver.xotics.datamodel.core.XoXPathStaticContext sc,
XoRequestToolkit rt)
Creates a new instance. |
Method Summary | |
java.lang.Object |
clone()
Clone method |
XpContext |
cloneContext(XdpSequence newSeq)
Clone this context with a new context sequence provided as argument |
XdpSequence |
getContextSequence()
returns the context sequence |
int |
getCurrentPosition()
Returns position of current context item in context sequence. |
java.lang.Class |
getDataTypeClass(java.lang.String qname)
Returns the class of a registered XS datatype identified by a QName of the form : prefix:localname, format used to reference a datatype or a function in an XPath request. |
java.lang.Class |
getFunctionClass(java.lang.String qname)
Returns the class of a registered XPath function identified by a QName of the form : prefix:localname, format used to reference a datatype or a function in an XPath request. |
java.lang.String |
getNamespace(java.lang.String prefix)
Returns the namespace associated to prefix param. |
java.lang.String |
getPrefix(java.lang.String namespace)
Returns the prefix associated to namespace param. |
XoRequestToolkit |
getRequestToolkit()
Returns current request toolkit. |
java.util.Map |
getVariables()
Returns current XPath variables defined in this dynamic context |
boolean |
isInstance(XsdDataType dt,
java.lang.String qname)
Utility method to know whether dt param derives from or is instance of
XS datatype (in XSD context) identified by gname (in prefix:localname format).
|
boolean |
isInstance(XsdDataType dt,
java.lang.String[] ns,
java.lang.String[] localName)
Utility method to perform multiple checks like isInstance(XsdDataType, String, String) does. |
boolean |
isInstance(XsdDataType dt,
java.lang.String ns,
java.lang.String localName)
same method as isInstance(XsdDataType, String) with a dattype designated by
namespace and local name rather than prefix:localname. |
boolean |
isNumericType(XsdDataType dt)
Utility method to know if dt is a numeric XSD. |
void |
setContextSequence(XdpSequence contextSequence)
sets the context sequence |
void |
setCurrentPosition(int currentPosition)
Sets position of current context item in context sequence. |
void |
setVariables(java.util.Map variables)
Sets a new Map containing couples (variable name, value), as XPath variables. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XpContext(com.virtualweaver.xotics.datamodel.core.XoXPathStaticContext sc, XoRequestToolkit rt)
sc
- static context, not visible : all its features are wrapped
and made available by this
.rt
- the request toolkit to useMethod Detail |
public java.lang.Object clone()
public XpContext cloneContext(XdpSequence newSeq)
newSeq
- a new XPath Context sequence
public java.util.Map getVariables()
public void setVariables(java.util.Map variables)
variables
- new XPath variablespublic XdpSequence getContextSequence()
public void setContextSequence(XdpSequence contextSequence)
contextSequence
- the new context sequencepublic int getCurrentPosition()
public void setCurrentPosition(int currentPosition)
currentPosition
- new position of context item or 0 if no context itempublic XoRequestToolkit getRequestToolkit()
XoRequestToolkit
per DM instance.
public java.lang.String getPrefix(java.lang.String namespace)
namespace
param. This namespace concerns both
XPath functions and new XS datatypes.
namespace
- a namespace for XPath function or XS datatype
public java.lang.String getNamespace(java.lang.String prefix)
prefix
param. This namespace concerns both
XPath functions and new XS datatypes.
prefix
- a prefix for XPath function or XS datatype
public java.lang.Class getDataTypeClass(java.lang.String qname)
qname
- a string of the form prefix:localname
XsdDataType
class, or null if not found.public java.lang.Class getFunctionClass(java.lang.String qname)
qname
- a string of the form prefix:localname
XpFunction
class, or null if not found.public boolean isInstance(XsdDataType dt, java.lang.String qname)
Utility method to know whether dt
param derives from or is instance of
XS datatype (in XSD context) identified by gname
(in prefix:localname format).
This method is important because in Xotics API, derivation hierarchy tree of XS datatypes
is not allways the same as Java derivation hierarchy.
For instance : XsdShort
represents an XSD short, which derives from an XSD int,
but XsdShort
class derives from XsdAnySimpleType
class and not from
Xsdint
class.
dt
- a datatype to checkqname
- a prefix:localname string identifying an XS datatype
dt
represents an XSD derived from qname
.public boolean isInstance(XsdDataType dt, java.lang.String ns, java.lang.String localName)
isInstance(XsdDataType, String)
with a dattype designated by
namespace and local name rather than prefix:localname.
dt
- datatype to checkns
- namespace of a particular XSDlocalName
- local name of a particular XSD
dt
represents an XSD derived from XSD designated by
ns:localName
public boolean isNumericType(XsdDataType dt)
dt
is a numeric XSD. Numeric XSD are :
dt
- datatype to check
dt is instance of or derived from one of XSD numeric types.
public boolean isInstance(XsdDataType dt, java.lang.String[] ns, java.lang.String[] localName)
isInstance(XsdDataType, String, String)
does.
dt
- datatype to checkns
- namespace of particular XSD listlocalName
- local name of particular XSD list
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |