|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.saxon.type.ExternalObjectType
This class represents the type of an external Java object returned by an extension function, or supplied as an external variable/parameter.
| Field Summary |
| Fields inherited from interface net.sf.saxon.type.SchemaType |
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION |
| Fields inherited from interface net.sf.saxon.type.SchemaComponent |
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
| Constructor Summary | |
ExternalObjectType(java.lang.Class javaClass,
Configuration config)
|
|
| Method Summary | |
boolean |
allowsDerivation(int derivation)
Determines whether derivation (of a particular kind) from this type is allowed, based on the "final" property |
void |
analyzeContentExpression(Expression expression,
int kind,
StaticContext env)
Analyze an expression to see whether the expression is capable of delivering a value of this type. |
static void |
analyzeContentExpression(SimpleType simpleType,
Expression expression,
StaticContext env,
int kind)
Analyze an expression to see whether the expression is capable of delivering a value of this type. |
java.lang.CharSequence |
applyWhitespaceNormalization(java.lang.CharSequence value)
Apply the whitespace normalization rules for this simple type |
Value |
atomize(NodeInfo node)
Get the typed value of a node that is annotated with this schema type. |
void |
checkTypeDerivationIsOK(SchemaType type,
int block)
Check that this type is validly derived from a given type |
AtomicType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item of this type is atomized |
SchemaType |
getBaseType()
Returns the base type that this type inherits from. |
int |
getBlock()
Returns the value of the 'block' attribute for this type, as a bit-signnificant integer with fields such as SchemaType.DERIVATION_LIST and SchemaType.DERIVATION_EXTENSION |
SchemaType |
getBuiltInBaseType()
Returns the built-in base type this type is derived from. |
AtomicType |
getCommonAtomicType()
Get the most specific possible atomic type that all items in this SimpleType belong to |
int |
getDerivationMethod()
Gets the integer code of the derivation method used to derive this type from its parent. |
java.lang.String |
getDescription()
Get a description of this type for use in error messages. |
java.lang.String |
getDisplayName()
Get the display name of the type: that is, a lexical QName with an arbitrary prefix |
int |
getFingerprint()
Get the fingerprint of the name of this type |
java.lang.Class |
getJavaClass()
|
SchemaType |
getKnownBaseType()
Returns the base type that this type inherits from. |
int |
getNameCode()
Get the namecode of the name of this type. |
ItemType |
getPrimitiveItemType()
Get the primitive item type corresponding to this item type. |
int |
getPrimitiveType()
Get the primitive type corresponding to this item type. |
int |
getRelationship(ExternalObjectType other)
Get the relationship of this external object type to another external object type |
ItemType |
getSuperType(TypeHierarchy th)
Get the type from which this item type is derived by restriction. |
SequenceIterator |
getTypedValue(java.lang.CharSequence value,
NamespaceResolver resolver,
NameChecker nameChecker)
Get the typed value corresponding to a given string value, assuming it is valid against this type |
SequenceIterator |
getTypedValue(NodeInfo node)
Get the typed value of a node that is annotated with this schema type |
int |
getValidationStatus()
Get the validation status - always valid |
int |
getWhitespaceAction(TypeHierarchy th)
Determine the whitespace normalization required for values of this type |
boolean |
isAnonymousType()
Test whether this is an anonymous type |
boolean |
isAtomicType()
Test whether this Simple Type is an atomic type |
boolean |
isBuiltIn()
|
boolean |
isComplexType()
Test whether this SchemaType is a complex type |
boolean |
isExternalType()
Return true if this is an external object type, that is, a Saxon-defined type for external Java or .NET objects |
boolean |
isListType()
Returns true if this type is derived by list, or if it is derived by restriction from a list type, or if it is a union that contains a list as one of its members |
boolean |
isNamespaceSensitive()
Test whether this simple type is namespace-sensitive, that is, whether it is derived from xs:QName or xs:NOTATION |
boolean |
isSameType(SchemaType other)
Test whether this is the same type as another type. |
boolean |
isSimpleType()
Returns true if this SchemaType is a SimpleType |
boolean |
isUnionType()
Return true if this type is a union type (that is, if its variety is union) |
AtomicValue |
makeDerivedValue(AtomicValue primValue,
java.lang.CharSequence lexicalValue,
boolean validate)
Factory method to create values of a derived atomic type. |
boolean |
matchesItem(Item item,
boolean allowURIPromotion,
Configuration config)
Test whether a given item conforms to this type |
java.lang.String |
toString()
|
java.lang.String |
toString(NamePool pool)
Produce a representation of this type name for use in error messages. |
ValidationException |
validateContent(java.lang.CharSequence value,
NamespaceResolver nsResolver,
NameChecker nameChecker)
Check whether a given input string is valid according to this SimpleType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ExternalObjectType(java.lang.Class javaClass,
Configuration config)
| Method Detail |
public boolean isExternalType()
isExternalType in interface SimpleTypepublic AtomicType getCommonAtomicType()
getCommonAtomicType in interface SimpleTypepublic final int getValidationStatus()
getValidationStatus in interface SchemaComponentSchemaComponent.UNVALIDATED, SchemaComponent.VALIDATING,
SchemaComponent.VALIDATED, SchemaComponent.INVALID, SchemaComponent.INCOMPLETEpublic final int getBlock()
SchemaType.DERIVATION_LIST and SchemaType.DERIVATION_EXTENSION
getBlock in interface SchemaTypepublic final int getDerivationMethod()
getDerivationMethod in interface SchemaTypeSchemaType.DERIVATION_RESTRICTIONpublic final boolean allowsDerivation(int derivation)
allowsDerivation in interface SchemaTypederivation - the kind of derivation, for example SchemaType.DERIVATION_LIST
public int getNameCode()
getNameCode in interface SchemaTypepublic final boolean isComplexType()
isComplexType in interface SchemaTypepublic final SchemaType getBaseType()
getBaseType in interface SchemaTypejava.lang.IllegalStateException - if this type is not valid.public ItemType getPrimitiveItemType()
getPrimitiveItemType in interface ItemTypepublic int getPrimitiveType()
getPrimitiveType in interface ItemTypepublic java.lang.String toString(NamePool pool)
toString in interface ItemTypepublic AtomicType getAtomizedItemType()
getAtomizedItemType in interface ItemTypepublic SchemaType getKnownBaseType()
java.lang.IllegalStateException - if this type is not valid.public boolean isSameType(SchemaType other)
isSameType in interface SchemaTypepublic int getRelationship(ExternalObjectType other)
TypeHierarchy, for example TypeHierarchy.SUBSUMESpublic java.lang.String getDescription()
SchemaType
getDescription in interface SchemaType
public void checkTypeDerivationIsOK(SchemaType type,
int block)
throws SchemaException,
ValidationException
checkTypeDerivationIsOK in interface SchemaTypetype - the type from which this type is derivedblock - the derivations that are blocked by the relevant element declaration
SchemaException - if the derivation is not allowed
ValidationExceptionpublic final boolean isSimpleType()
isSimpleType in interface SchemaTypepublic boolean isAtomicType()
isAtomicType in interface SimpleTypepublic boolean isListType()
isListType in interface SimpleTypepublic boolean isUnionType()
isUnionType in interface SimpleTypepublic int getWhitespaceAction(TypeHierarchy th)
getWhitespaceAction in interface SimpleTypeth -
public java.lang.CharSequence applyWhitespaceNormalization(java.lang.CharSequence value)
throws ValidationException
value - the string before whitespace normalization
ValidationExceptionpublic SchemaType getBuiltInBaseType()
getBuiltInBaseType in interface SimpleTypepublic boolean isNamespaceSensitive()
isNamespaceSensitive in interface SimpleTypepublic boolean isAnonymousType()
isAnonymousType in interface SchemaTypepublic final SequenceIterator getTypedValue(NodeInfo node)
getTypedValue in interface SchemaTypenode - the node whose typed value is required
AtomicValue
public Value atomize(NodeInfo node)
throws XPathException
getTypedValue(net.sf.saxon.om.NodeInfo). However, this method is often more convenient and may be
more efficient, especially in the common case where the value is expected to be a singleton.
atomize in interface SchemaTypenode - the node whose typed value is required
XPathException
public SequenceIterator getTypedValue(java.lang.CharSequence value,
NamespaceResolver resolver,
NameChecker nameChecker)
throws ValidationException
getTypedValue in interface SimpleTypevalue - the string valueresolver - a namespace resolver used to resolve any namespace prefixes appearing
in the content of values. Can supply null, in which case any namespace-sensitive content
will be rejected.nameChecker -
AtomicValue
ValidationException - if the supplied value is not in the lexical space of the data type
public AtomicValue makeDerivedValue(AtomicValue primValue,
java.lang.CharSequence lexicalValue,
boolean validate)
makeDerivedValue in interface AtomicTypeprimValue - the value in the value space of the primitive typelexicalValue - the value in the lexical space. If null, the string value of primValuevalidate - true if the value is to be validated against the facets of the derived
type; false if the caller knows that the value is already valid.
public void analyzeContentExpression(Expression expression,
int kind,
StaticContext env)
throws XPathException
analyzeContentExpression in interface SchemaTypeexpression - the expression that delivers the contentkind - the node kind whose content is being delivered: Type.ELEMENT,
Type.ATTRIBUTE, or Type.DOCUMENTenv -
XPathException - if the expression will never deliver a value of the correct type
public static void analyzeContentExpression(SimpleType simpleType,
Expression expression,
StaticContext env,
int kind)
throws XPathException
simpleType - the simple type against which the expression is to be checkedexpression - the expression that delivers the contentkind - the node kind whose content is being delivered: Type.ELEMENT,
Type.ATTRIBUTE, or Type.DOCUMENT
XPathException - if the expression will never deliver a value of the correct typepublic java.lang.Class getJavaClass()
public boolean isBuiltIn()
public boolean matchesItem(Item item,
boolean allowURIPromotion,
Configuration config)
ItemType
matchesItem in interface ItemTypeitem - The item to be testedallowURIPromotion - config -
public ValidationException validateContent(java.lang.CharSequence value,
NamespaceResolver nsResolver,
NameChecker nameChecker)
validateContent in interface SimpleTypevalue - the input string to be checkednsResolver - a namespace resolver used to resolve namespace prefixes if the type
is namespace sensitive. The value supplied may be null; in this case any namespace-sensitive
content will throw an UnsupportedOperationException.nameChecker -
java.lang.UnsupportedOperationException - if the type is namespace-sensitive and no namespace
resolver is suppliedpublic ItemType getSuperType(TypeHierarchy th)
ItemTypeIn fact the concept of "supertype" is not really well-defined, because the types form a lattice rather than a hierarchy. The only real requirement on this function is that it returns a type that strictly subsumes this type, ideally as narrowly as possible.
getSuperType in interface ItemTypeth -
public int getFingerprint()
SchemaType
getFingerprint in interface SchemaTypepublic java.lang.String toString()
public java.lang.String getDisplayName()
SchemaType
getDisplayName in interface SchemaType
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||