Package net.sf.saxon.type
Class JavaExternalObjectType
java.lang.Object
net.sf.saxon.type.AnyExternalObjectType
net.sf.saxon.type.ExternalObjectType
net.sf.saxon.type.JavaExternalObjectType
- All Implemented Interfaces:
ItemType
This class represents the type of an external Java object returned by
an extension function, or supplied as an external variable/parameter.
-
Field Summary
FieldsFields inherited from class net.sf.saxon.type.AnyExternalObjectType
THE_INSTANCE
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
classNameToLocalName
(String className) Static method to convert a Java class name to an XPath local name.static StructuredQName
classNameToQName
(String className) Static method to get the QName corresponding to a Java class nameboolean
Test whether two ExternalObjectType objects represent the same typeClass
<?> Get the Java class to which this external object type correspondsgetName()
Get the local name of this type.Get the primitive item type corresponding to this item type.Get the relationship of this external object type to another external object typeGet the target namespace of this type.Get the name of this type as a StructuredQName, unless the type is anonymous, in which case return nullint
hashCode()
Returns a hash code value for the object.static String
localNameToClassName
(String className) Static method to convert an XPath local name to a Java class name.boolean
matches
(Item item, TypeHierarchy th) Test whether a given item conforms to this typestatic JavaExternalObjectType
Allocate an external object type.toString()
Methods inherited from class net.sf.saxon.type.ExternalObjectType
isPlainType
Methods inherited from class net.sf.saxon.type.AnyExternalObjectType
getAtomizedItemType, getBasicAlphaCode, getDefaultPriority, getGenre, getPrimitiveType, getUType, isAtomicType, isAtomizable
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.type.ItemType
explainMismatch, getFullAlphaCode, getNormalizedDefaultPriority, toExportString
-
Field Details
-
Method Details
-
of
Allocate an external object type. for a given Java class. Reuses a knownJavaExternalObjectType
if found in a static cache- Parameters:
javaClass
- the Java class to which this type corresponds- Returns:
- the corresponding
JavaExternalObjectType
-
getName
Get the local name of this type.- Specified by:
getName
in classExternalObjectType
- Returns:
- the fully qualified name of the Java class.
-
getTargetNamespace
Get the target namespace of this type. The is always NamespaceConstant.JAVA_TYPE.- Specified by:
getTargetNamespace
in classExternalObjectType
- Returns:
- the target namespace of this type definition.
-
getTypeName
Get the name of this type as a StructuredQName, unless the type is anonymous, in which case return null- Specified by:
getTypeName
in classExternalObjectType
- Returns:
- the name of the atomic type, or null if the type is anonymous.
-
getPrimitiveItemType
Get the primitive item type corresponding to this item type.- Specified by:
getPrimitiveItemType
in interfaceItemType
- Overrides:
getPrimitiveItemType
in classAnyExternalObjectType
- Returns:
- EXTERNAL_OBJECT_TYPE, the ExternalObjectType that encapsulates the Java type Object.class.
-
getRelationship
Get the relationship of this external object type to another external object type- Parameters:
other
- the other external object type- Returns:
- the relationship of this external object type to another external object type,
as one of the constants in class
Affinity
, for exampleAffinity.SUBSUMES
-
getJavaClass
Get the Java class to which this external object type corresponds- Returns:
- the corresponding Java class
-
matches
Test whether a given item conforms to this type- Specified by:
matches
in interfaceItemType
- Overrides:
matches
in classAnyExternalObjectType
- Parameters:
item
- The item to be testedth
- The type hierarchy cache- Returns:
- true if the item is an instance of this type; false otherwise
-
toString
- Overrides:
toString
in classExternalObjectType
-
getDisplayName
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
Test whether two ExternalObjectType objects represent the same type -
classNameToLocalName
Static method to convert a Java class name to an XPath local name. This involves the following substitutions: "$" is replaced by "-", and "[" is replaced by "_-". -
localNameToClassName
Static method to convert an XPath local name to a Java class name. This involves the following substitutions: "-" is replaced by "$", and leading "_-" pairs are replaced by "[". -
classNameToQName
Static method to get the QName corresponding to a Java class name
-