Package org.eclipse.wst.xml.xpath2.processor.internal
public class DefaultStaticContext extends java.lang.ObjectDefault implementation of a static context as described by the XPath 2.0 specification.
Constructor Summary |
DefaultStaticContext(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel model) |
DefaultStaticContext() |
Method Summary | |
public void | add_function_library(FunctionLibrary fl) Adds a function to the library. |
public void | add_namespace(java.lang.String prefix
,
java.lang.String namespace) adds namespace |
public void | add_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var) Adds a variable to current scope. used for static checking.... i.e. presence of variables |
public boolean | attribute_declared(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr) Checks if an attribute is in the in-scope schema definitions. |
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition | attribute_type_definition(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem) Retrieves type definition of the attribute in an element. |
public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI | base_uri() return the base URI |
public void | debug_print_vars() Debug function which will print current variable scopes and info. |
public java.lang.String | default_function_namespace() Retrieves the defaul function namespace |
public java.lang.String | default_namespace() Retrieves the default namespace, when one is not allocated |
public boolean | del_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var) Deletes a variable from current scope. |
public boolean | derives_from(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
,
org.eclipse.wst.xml.xpath2.processor.internal.types.QName et) Checks if an XML node derives from a specified type. |
public boolean | derives_from(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
,
org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition et) Checks if an XML node derives from a specified type definition. |
public void | destroy_scope() Destroys a scope. |
public boolean | element_declared(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem) is element declared? |
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition | element_type_definition(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem) Obtains schema definition of the type of an element. |
public boolean | expand_elem_type_qname(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name) Expands a qname and uses the default type/element namespace if unprefixed. |
public boolean | expand_function_qname(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name) Expands a qname and uses the default function namespace if unprefixed. |
public boolean | expand_qname(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name) Expands the qname's prefix into a namespace. |
public Function | function(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
,
int arity) |
public boolean | function_exists(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
,
int arity) Check for existance of function. |
public java.lang.String | get_cntxt_item_type() |
public java.util.Map | get_collections() |
public java.lang.String | get_default_collection_type() |
public java.util.Map | get_documents() |
public java.util.Map | get_function_libraries() |
protected java.lang.Object | get_var(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var) |
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel | getTypeModel(org.w3c.dom.Node node) |
public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType | make_atomic(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name) Creates an atomic from a specific type name initialized with a default value. |
public void | new_scope() Creates a new scope level. |
public boolean | prefix_exists(java.lang.String pref) does prefix exist? |
public java.lang.String | resolve_prefix(java.lang.String pref) Resolves a prefix into a namespace URI. |
public void | set_base_uri(java.lang.String baseuri) Set the Base URI for the static context. |
public void | set_cntxt_item_type(java.lang.String cntxtItemType) |
public void | set_collections(java.util.Map collections) |
public void | set_default_collection_type(java.lang.String defaultCollectionType) |
public void | set_documents(java.util.Map _documents) |
protected void | set_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
,
org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val) |
protected void | set_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
,
org.eclipse.wst.xml.xpath2.processor.ResultSequence val) |
public boolean | type_defined(org.eclipse.wst.xml.xpath2.processor.internal.types.QName qname) Checks whether the type is defined in the in scope schema definitions. |
public boolean | type_defined(java.lang.String ns
,
java.lang.String type) Checks whether the type is defined in the in scope schema definitions. |
public boolean | variable_exists(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var) does variable exist in current scope ? |
public boolean | variable_in_scope(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var) checks to see if variable is in scope |
public boolean | xpath1_compatible() is it xpath1 compatible? |
Constructor Detail |
public DefaultStaticContext(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel model)
Constructor.
public DefaultStaticContext()
Constructor for schema-less documents.
Methods Detail |
public void add_function_library(FunctionLibrary fl)
Adds a function to the library.
fl
- Function library to add.
public void add_namespace(java.lang.String prefix
,
java.lang.String namespace)
adds namespace
prefix
- namespace prefix
namespace
- namespace URI
public void add_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)
Adds a variable to current scope. used for static checking.... i.e. presence of variables
var
- variable name to add.
public boolean attribute_declared(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)
Checks if an attribute is in the in-scope schema definitions.
attr
- name of attribute.
boolean
- true if attribute is declared.
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition attribute_type_definition(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)
Retrieves type definition of the attribute in an element.
elem
- element name
org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition
- schema definition of the type of the attribute
public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI base_uri()
return the base URI
org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI
- XSAnyURI
public void debug_print_vars()
Debug function which will print current variable scopes and info.
public java.lang.String default_function_namespace()
Retrieves the defaul function namespace
java.lang.String
- string
public java.lang.String default_namespace()
Retrieves the default namespace, when one is not allocated
java.lang.String
- string
public boolean del_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)
Deletes a variable from current scope.
var
- variable name to delete.
boolean
- false if variable doesn't exist.
public boolean derives_from(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
,
org.eclipse.wst.xml.xpath2.processor.internal.types.QName et)
Checks if an XML node derives from a specified type.
at
- node actual type
et
- name of expected type
boolean
- true if a derivation exists
public boolean derives_from(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
,
org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition et)
Checks if an XML node derives from a specified type definition.
at
- node actual type.
et
- type definition of expected type.
boolean
- true if a derivation exists.
public void destroy_scope()
Destroys a scope.
public boolean element_declared(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)
is element declared?
elem
- name of element.
boolean
- true if element declared.
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition element_type_definition(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)
Obtains schema definition of the type of an element.
elem
- name of element who's type is desired.
org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition
- schema definition of type
public boolean expand_elem_type_qname(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)
Expands a qname and uses the default type/element namespace if unprefixed.
name
- qname to expand.
boolean
- true on success.
public boolean expand_function_qname(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)
Expands a qname and uses the default function namespace if unprefixed.
name
- qname to expand.
boolean
- true on success.
public boolean expand_qname(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)
Expands the qname's prefix into a namespace.
name
- qname to expand.
boolean
- true on success.
public Function function(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
,
int arity)
name
arity
Function
public boolean function_exists(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
,
int arity)
Check for existance of function.
name
- function name.
arity
- arity of function.
boolean
- true if function exists. False otherwise.
public java.lang.String get_cntxt_item_type()
java.lang.String
public java.util.Map get_collections()
java.util.Map
public java.lang.String get_default_collection_type()
java.lang.String
public java.util.Map get_documents()
java.util.Map
public java.util.Map get_function_libraries()
java.util.Map
protected java.lang.Object get_var(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)
var
java.lang.Object
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel getTypeModel(org.w3c.dom.Node node)
node
org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel
public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType make_atomic(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)
Creates an atomic from a specific type name initialized with a default value.
name
- name of type to create
org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType
- Atomic type of desired type.
public void new_scope()
Creates a new scope level.
public boolean prefix_exists(java.lang.String pref)
does prefix exist?
pref
- prefix name.
boolean
- true if it does.
public java.lang.String resolve_prefix(java.lang.String pref)
Resolves a prefix into a namespace URI.
pref
- prefix name
java.lang.String
- uri prefix is resolved to or null.
public void set_base_uri(java.lang.String baseuri)
Set the Base URI for the static context.
baseuri
public void set_cntxt_item_type(java.lang.String cntxtItemType)
cntxtItemType
public void set_collections(java.util.Map collections)
collections
public void set_default_collection_type(java.lang.String defaultCollectionType)
defaultCollectionType
public void set_documents(java.util.Map _documents)
_documents
protected void set_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
,
org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)
var
val
protected void set_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
,
org.eclipse.wst.xml.xpath2.processor.ResultSequence val)
var
val
public boolean type_defined(org.eclipse.wst.xml.xpath2.processor.internal.types.QName qname)
Checks whether the type is defined in the in scope schema definitions.
qname
- type name.
boolean
- true if type is defined.
public boolean type_defined(java.lang.String ns
,
java.lang.String type)
Checks whether the type is defined in the in scope schema definitions.
ns
- namespace of type.
type
- name of type.
boolean
- true if type is defined.
public boolean variable_exists(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)
does variable exist in current scope ?
var
- variable name.
boolean
- true if it does.
public boolean variable_in_scope(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)
checks to see if variable is in scope
var
- variable name.
boolean
- true if variable is in current or above scope.
public boolean xpath1_compatible()
is it xpath1 compatible?
boolean
- boolean