Package com.yahoo.document
Class StructuredDataType
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.document.DataType
-
- com.yahoo.document.StructuredDataType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<DataType>
- Direct Known Subclasses:
BaseStructDataType
,DocumentType
public abstract class StructuredDataType extends DataType
TODO: What is this and why- Author:
- HÃ¥kon Humberset
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StructuredDataType(int id, java.lang.String name)
StructuredDataType(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FieldPath
buildFieldPath(java.lang.String remainFieldName)
Creates a field path from the given field path string.protected FieldValue
createByReflection(java.lang.Object arg)
Creates a field value by reflectionabstract StructuredFieldValue
createFieldValue()
Creates a new, empty FieldValue of this typeprotected static int
createId(java.lang.String name)
boolean
equals(java.lang.Object o)
DataTypeName
getDataTypeName()
Returns the name of this as a DataTypeNameabstract Field
getField(int id)
Gets the field with the specified id.abstract Field
getField(java.lang.String name)
Gets the field matching a given name.abstract java.util.Collection<Field>
getFields()
int
hashCode()
protected void
register(DocumentTypeManager manager, java.util.List<DataType> seenTypes)
-
Methods inherited from class com.yahoo.document.DataType
clone, compareTo, createFieldValue, getArray, getCode, getId, getMap, getName, getPrimitiveType, getTensor, getValueClass, getWeightedSet, getWeightedSet, isAssignableFrom, isMultivalue, isRegistered, isValueCompatible, lastPredefinedDataTypeId, register, setId, setName, toString, visitMembers
-
-
-
-
Method Detail
-
createId
protected static int createId(java.lang.String name)
-
createFieldValue
public abstract StructuredFieldValue createFieldValue()
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classDataType
-
createByReflection
protected FieldValue createByReflection(java.lang.Object arg)
Description copied from class:DataType
Creates a field value by reflection- Overrides:
createByReflection
in classDataType
- Parameters:
arg
- the value of the newly created field value- Returns:
- a fully constructed value
-
getDataTypeName
public DataTypeName getDataTypeName()
Returns the name of this as a DataTypeName- Returns:
- Return the Documentname of this doumenttype.
-
getField
public abstract Field getField(java.lang.String name)
Gets the field matching a given name.- Parameters:
name
- The name of a field.- Returns:
- Returns the matching field, or null if not found.
-
getField
public abstract Field getField(int id)
Gets the field with the specified id.- Parameters:
id
- the id of the field to return.- Returns:
- the matching field, or null if not found.
-
getFields
public abstract java.util.Collection<Field> getFields()
-
register
protected void register(DocumentTypeManager manager, java.util.List<DataType> seenTypes)
-
buildFieldPath
public FieldPath buildFieldPath(java.lang.String remainFieldName)
Description copied from class:DataType
Creates a field path from the given field path string.- Overrides:
buildFieldPath
in classDataType
- Parameters:
remainFieldName
- a string containing the field path- Returns:
- Returns a valid field path, parsed from the string
-
-