Package com.yahoo.document
Class DocumentTypeManager
java.lang.Object
com.yahoo.document.DocumentTypeManager
The DocumentTypeManager keeps track of the document types registered in
the Vespa common repository.
The DocumentTypeManager is also responsible for registering a FieldValue factory for each data type a field can have. The Document object uses this factory to serialize and deserialize the various datatypes. The factory could also be used to expand the functionality of various datatypes, for instance displaying the data type in human-readable form or as XML.
- Author:
- Thomas Gundersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assign
(DocumentTypeManager other) void
clear()
Deprecated.//TODO Will be package-private or removed on Vespa 8Deprecated.//TODO Will be package-private or removed on Vespa 8final Document
createDocument
(com.yahoo.io.GrowableByteBuffer buf) static DocumentTypeManager
Only for unit testsgetDataType
(int code) Deprecated.//TODO Will be package-private or removed on Vespa 8getDataType
(int code, String detailedType) Deprecated.//TODO Will be package-private or removed on Vespa 8getDataType
(String name) Deprecated.//TODO Will be package-private or removed on Vespa 8 Use constants and factories in DataType instead.Returns a read only view of the registered data typesgetDocumentType
(DataTypeName name) Gets a registered document.getDocumentType
(String name) Returns a registered document typeA read only view of the registered document typesboolean
hasDataType
(int code) Deprecated.//TODO Will be package-private or removed on Vespa 8boolean
hasDataType
(String name) void
Register a data type of any sort, including document types.registerDocumentType
(DocumentType docType) Registers a document type.void
shutdown()
Deprecated.//TODO Will be package-private or removed on Vespa 8
-
Constructor Details
-
DocumentTypeManager
public DocumentTypeManager() -
DocumentTypeManager
-
-
Method Details
-
assign
-
configure
Deprecated.//TODO Will be package-private or removed on Vespa 8For testing, use fromFile factory method instead -
fromFile
Only for unit tests -
hasDataType
-
hasDataType
Deprecated.//TODO Will be package-private or removed on Vespa 8 -
getDataType
Deprecated.//TODO Will be package-private or removed on Vespa 8 Use constants and factories in DataType instead. For structs, use getStructType() in DocumentType. For annotation payloads, use getDataType() in AnnotationType. -
getDataType
Deprecated.//TODO Will be package-private or removed on Vespa 8 -
getDataType
Deprecated.//TODO Will be package-private or removed on Vespa 8Return a data type instance- Parameters:
code
- the code of the data type to return, which must be either built in or present in this managerdetailedType
- detailed type information, or the empty string if none- Returns:
- the appropriate DataType instance
-
register
Register a data type of any sort, including document types.- Parameters:
type
- The datatype to register TODO Give unique ids to document types
-
registerDocumentType
Registers a document type. Typically called by someone importing the document types from the common Vespa repository.- Parameters:
docType
- The document type to register.- Returns:
- the previously registered type, or null if none was registered
-
getDocumentType
Gets a registered document.- Parameters:
name
- the document name of the type- Returns:
- returns the document type found, or null if there is no type with this name
-
getDocumentType
Returns a registered document type- Parameters:
name
- the type name of the document type- Returns:
- returns the document type having this name, or null if none
-
createDocument
-
createDocument
-
getDataTypes
Returns a read only view of the registered data types- Returns:
- collection of types
-
getDocumentTypes
A read only view of the registered document types- Returns:
- map of types
-
documentTypeIterator
-
clear
Deprecated.//TODO Will be package-private or removed on Vespa 8Clears the DocumentTypeManager. After this operation, only the default document type and data types are available. -
getAnnotationTypeRegistry
-
shutdown
Deprecated.//TODO Will be package-private or removed on Vespa 8
-