Top Description Fields Constructors Methods
org.apache.xerces.impl.dv

public abstract Class SchemaDVFactory

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.xerces.impl.dv.xs.BaseDVFactory, org.apache.xerces.impl.dv.xs.BaseSchemaDVFactory
Imports
org.apache.xerces.util.SymbolHash, org.apache.xerces.xs.XSObjectList

Defines a factory API that enables applications to

1. to get the instance of specified SchemaDVFactory implementation

2. to create/return built-in schema simple types

3. to create user defined simple types.

Implementations of this abstract class can be used to get built-in simple types and create user-defined simle types.

The implementation should store the built-in datatypes in static data, so that they can be shared by multiple parser instance, and multiple threads.

Author
Sandy Gao, IBM
Version
$Id: SchemaDVFactory.java 558582 2007-07-23 02:05:04Z mrglavas $

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract XSSimpleType

Returns:

the newly created simple type
createTypeList
(String
name of the new type, could be null
name
,
String
target namespace of the new type, could be null
targetNamespace
,
short
value of "final"
finalSet
,
XSSimpleType
item type of the list type
itemType
,
XSObjectList
set of annotations
annotations
)

Create a new simple type which is derived by list from another simple type.

public abstract XSSimpleType

Returns:

the newly created simple type
createTypeRestriction
(String
name of the new type, could be null
name
,
String
target namespace of the new type, could be null
targetNamespace
,
short
value of "final"
finalSet
,
XSSimpleType
base type of the new type
base
,
XSObjectList
set of annotations
annotations
)

Create a new simple type which is derived by restriction from another simple type.

public abstract XSSimpleType

Returns:

the newly created simple type
createTypeUnion
(String
name of the new type, could be null
name
,
String
target namespace of the new type, could be null
targetNamespace
,
short
value of "final"
finalSet
,
XSSimpleType[]
member types of the union type
memberTypes
,
XSObjectList
set of annotations
annotations
)

Create a new simple type which is derived by union from a list of other simple types.

public abstract XSSimpleType

Returns:

the datatype validator of the given name
getBuiltInType
(String
the name of the datatype
name
)

Get a built-in simple type of the given name REVISIT: its still not decided within the Schema WG how to define the ur-types and if all simple types should be derived from a complex type, so as of now we ignore the fact that anySimpleType is derived from anyType, and pass 'null' as the base of anySimpleType.

public abstract SymbolHash

Returns:

a SymbolHash which contains all built-in simple types
getBuiltInTypes
()

get all built-in simple types, which are stored in a SymbolHash keyed by the name

public static final SchemaDVFactory

Returns:

an instance of SchemaDVFactory implementation
getInstance
()

Get a default instance of SchemaDVFactory implementation.

public static final SchemaDVFactory

Returns:

an instance of SchemaDVFactory implementation
getInstance
(String
name of the schema factory implementation to instantiate.
factoryClass
)

Get an instance of SchemaDVFactory implementation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_FACTORY_CLASSback to summary
private static final String DEFAULT_FACTORY_CLASS

Constructor Detail

SchemaDVFactoryback to summary
protected SchemaDVFactory()

Method Detail

createTypeListback to summary
public abstract XSSimpleType createTypeList(String name, String targetNamespace, short finalSet, XSSimpleType itemType, XSObjectList annotations)

Create a new simple type which is derived by list from another simple type.

Parameters
name:String

name of the new type, could be null

targetNamespace:String

target namespace of the new type, could be null

finalSet:short

value of "final"

itemType:XSSimpleType

item type of the list type

annotations:XSObjectList

set of annotations

Returns:XSSimpleType

the newly created simple type

createTypeRestrictionback to summary
public abstract XSSimpleType createTypeRestriction(String name, String targetNamespace, short finalSet, XSSimpleType base, XSObjectList annotations)

Create a new simple type which is derived by restriction from another simple type.

Parameters
name:String

name of the new type, could be null

targetNamespace:String

target namespace of the new type, could be null

finalSet:short

value of "final"

base:XSSimpleType

base type of the new type

annotations:XSObjectList

set of annotations

Returns:XSSimpleType

the newly created simple type

createTypeUnionback to summary
public abstract XSSimpleType createTypeUnion(String name, String targetNamespace, short finalSet, XSSimpleType[] memberTypes, XSObjectList annotations)

Create a new simple type which is derived by union from a list of other simple types.

Parameters
name:String

name of the new type, could be null

targetNamespace:String

target namespace of the new type, could be null

finalSet:short

value of "final"

memberTypes:XSSimpleType[]

member types of the union type

annotations:XSObjectList

set of annotations

Returns:XSSimpleType

the newly created simple type

getBuiltInTypeback to summary
public abstract XSSimpleType getBuiltInType(String name)

Get a built-in simple type of the given name REVISIT: its still not decided within the Schema WG how to define the ur-types and if all simple types should be derived from a complex type, so as of now we ignore the fact that anySimpleType is derived from anyType, and pass 'null' as the base of anySimpleType. It needs to be changed as per the decision taken.

Parameters
name:String

the name of the datatype

Returns:XSSimpleType

the datatype validator of the given name

getBuiltInTypesback to summary
public abstract SymbolHash getBuiltInTypes()

get all built-in simple types, which are stored in a SymbolHash keyed by the name

Returns:SymbolHash

a SymbolHash which contains all built-in simple types

getInstanceback to summary
public static final SchemaDVFactory getInstance() throws DVFactoryException

Get a default instance of SchemaDVFactory implementation.

Returns:SchemaDVFactory

an instance of SchemaDVFactory implementation

Exceptions
DVFactoryException:
cannot create an instance of the specified class name or the default class name
getInstanceback to summary
public static final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException

Get an instance of SchemaDVFactory implementation.

Parameters
factoryClass:String

name of the schema factory implementation to instantiate.

Returns:SchemaDVFactory

an instance of SchemaDVFactory implementation

Exceptions
DVFactoryException:
cannot create an instance of the specified class name or the default class name