Top Description Methods
com.sun.msv.reader.datatype

public Interface DataTypeVocabulary

Known Direct Implementers
com.sun.msv.reader.datatype.xsd.XSDVocabulary, com.sun.msv.reader.trex.classic.TREXGrammarReader.UndefinedDataTypeVocabulary
Imports
org.relaxng.datatype.Datatype, .DatatypeException, com.sun.msv.reader.State, com.sun.msv.util.StartTagInfo

this class is used to parse foreign datatype vocabulary. Each datatype vocabulary must be associated with one namespace URI. When the element with that namespace URI is first found, this object is instanciated. After that, whenever the element with the namespace URI is found, createTopLevelReaderState method will be used to parse the element (and its descendants.) And whenever a reference to this vocabulary by name (e.g., "mydt:mytypename") is found, getType method is called to resolve this name into DataType object. One instance of this class is used throughout the parsing of one grammar. Therefore, implementations are encouraged to take advantages of this property and keep context information (e.g., user-defined named datatypes).
Author
Kohsuke KAWAGUCHI

Method Summary

Modifier and TypeMethod and Description
public State

Returns:

null if given start tag is not recognized by this object. This method is called when an "island" of this vocabulary was found. The state returned from this method will be used to parse the root element of this island. The parent state of this state must implement TypeOwner or ExpressionOwner. In either case, the implementation must report its parsing result by calling either interface. If both interface is implemented, the implementation must notify via TypeOwner interface only and may not call methods of ExpressionOwner. If the parsed island is not a type definition (for example, comments or inclusion), the implementation may not call TypeOwner nor ExpressionOwner.
createTopLevelReaderState
(StartTagInfo tag)

creates a State object that will parse the element specified by tag parameter.

public Datatype

Returns:

a non-null valid datatype object.
getType
(String
local part of the qualified name, like "string" or "integer". prefix part must be removed by the caller.
localTypeName
)

resolves a type name to Datatype object.

Method Detail

createTopLevelReaderStateback to summary
public State createTopLevelReaderState(StartTagInfo tag)

creates a State object that will parse the element specified by tag parameter.

Returns:State

null if given start tag is not recognized by this object. This method is called when an "island" of this vocabulary was found. The state returned from this method will be used to parse the root element of this island. The parent state of this state must implement TypeOwner or ExpressionOwner. In either case, the implementation must report its parsing result by calling either interface. If both interface is implemented, the implementation must notify via TypeOwner interface only and may not call methods of ExpressionOwner. If the parsed island is not a type definition (for example, comments or inclusion), the implementation may not call TypeOwner nor ExpressionOwner.

getTypeback to summary
public Datatype getType(String localTypeName) throws DatatypeException

resolves a type name to Datatype object.

Parameters
localTypeName:String

local part of the qualified name, like "string" or "integer". prefix part must be removed by the caller.

Returns:Datatype

a non-null valid datatype object.

Exceptions
DatatypeException:
if the specified type name is a valid type name.