Class XMLSchemaReference
- java.lang.Object
-
- org.eclipse.persistence.oxm.schema.XMLSchemaReference
-
- All Implemented Interfaces:
XMLSchemaReference
- Direct Known Subclasses:
XMLSchemaClassPathReference,XMLSchemaFileReference,XMLSchemaURLReference
public abstract class XMLSchemaReference extends java.lang.Object implements XMLSchemaReference
Provides a way for a descriptor's reference to its schema to be specified. The schema can be reference through a classpath resource, a file or URL.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringresourceThe string used to access the XMLSchema, be it classpath resource, URL, or file nameprotected java.lang.StringschemaContextThe path to a simple/complex type definition or element in the schemaprotected javax.xml.namespace.QNameschemaContextAsQNameprotected inttypeIndicates if a simple/complex type definition, element, or group is being referenced-
Fields inherited from interface org.eclipse.persistence.platform.xml.XMLSchemaReference
COMPLEX_TYPE, ELEMENT, GROUP, SIMPLE_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedXMLSchemaReference()The default constructor.protectedXMLSchemaReference(java.lang.String resource)This constructor takes a string that references an XMLSchema.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetResource()java.lang.StringgetSchemaContext()Get the path to the simple/complex type definition, element or group to be referenced in the schemajavax.xml.namespace.QNamegetSchemaContextAsQName()javax.xml.namespace.QNamegetSchemaContextAsQName(org.eclipse.persistence.internal.oxm.NamespaceResolver nsResolver)INTERNAL:intgetType()Indicates if the schema reference references a simple type definition, complex type definition, element, or group.abstract java.net.URLgetURL()A URL which referenes the Schema.voidinitialize(org.eclipse.persistence.internal.core.sessions.CoreAbstractSession session)Allow subclasses to perform initialization if required.booleanisGlobalDefinition()Indicates a global definitionbooleanisValid(org.w3c.dom.Document document, org.xml.sax.ErrorHandler errorHandler)voidsetResource(java.lang.String resource)voidsetSchemaContext(java.lang.String schemaContext)Set the path to the simple/complex type definition, element, or group to be referenced in the schemavoidsetSchemaContextAsQName(javax.xml.namespace.QName qname)voidsetType(int type)Set to indicate if the schema reference references a simple type definition, complex type definition, element or group.
-
-
-
Field Detail
-
resource
protected java.lang.String resource
The string used to access the XMLSchema, be it classpath resource, URL, or file name
-
schemaContext
protected java.lang.String schemaContext
The path to a simple/complex type definition or element in the schema
-
type
protected int type
Indicates if a simple/complex type definition, element, or group is being referenced
-
schemaContextAsQName
protected javax.xml.namespace.QName schemaContextAsQName
-
-
Constructor Detail
-
XMLSchemaReference
protected XMLSchemaReference()
The default constructor.
-
XMLSchemaReference
protected XMLSchemaReference(java.lang.String resource)
This constructor takes a string that references an XMLSchema.- Parameters:
resource- - used to access the XMLSchema (classpath, URL, or file name)
-
-
Method Detail
-
getResource
public java.lang.String getResource()
-
setResource
public void setResource(java.lang.String resource)
-
getURL
public abstract java.net.URL getURL()
Description copied from interface:XMLSchemaReferenceA URL which referenes the Schema.- Specified by:
getURLin interfaceXMLSchemaReference- Returns:
- the schema URL
-
getType
public int getType()
Indicates if the schema reference references a simple type definition, complex type definition, element, or group.- Specified by:
getTypein interfaceXMLSchemaReference- Returns:
- COMPLEX_TYPE=1, SIMPLE_TYPE=2, ELEMENT=3, GROUP=5
-
setType
public void setType(int type)
Set to indicate if the schema reference references a simple type definition, complex type definition, element or group.- Parameters:
type- - COMPLEX_TYPE=1, SIMPLE_TYPE=2, ELEMENT=3, GROUP=5
-
getSchemaContext
public java.lang.String getSchemaContext()
Get the path to the simple/complex type definition, element or group to be referenced in the schema- Specified by:
getSchemaContextin interfaceXMLSchemaReference- Returns:
- the schema context
-
setSchemaContext
public void setSchemaContext(java.lang.String schemaContext)
Set the path to the simple/complex type definition, element, or group to be referenced in the schema- Parameters:
schemaContext- - the schema context
-
setSchemaContextAsQName
public void setSchemaContextAsQName(javax.xml.namespace.QName qname)
-
getSchemaContextAsQName
public javax.xml.namespace.QName getSchemaContextAsQName()
-
getSchemaContextAsQName
public javax.xml.namespace.QName getSchemaContextAsQName(org.eclipse.persistence.internal.oxm.NamespaceResolver nsResolver)
INTERNAL:- Parameters:
nsResolver-- Returns:
-
isValid
public boolean isValid(org.w3c.dom.Document document, org.xml.sax.ErrorHandler errorHandler)
-
isGlobalDefinition
public boolean isGlobalDefinition()
Indicates a global definition
-
initialize
public void initialize(org.eclipse.persistence.internal.core.sessions.CoreAbstractSession session)
Allow subclasses to perform initialization if required. This method will typically be called during the owning descriptor's initialization phase.- Parameters:
session-
-
-