Package com.yahoo.docproc.proxy
Class ProxyDocument
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.document.datatypes.FieldValue
com.yahoo.document.datatypes.CompositeFieldValue
com.yahoo.document.datatypes.StructuredFieldValue
com.yahoo.document.Document
com.yahoo.docproc.proxy.ProxyDocument
- All Implemented Interfaces:
DocumentOperationWrapper
,Cloneable
,Comparable<com.yahoo.document.datatypes.FieldValue>
This is a facade to a Document, with two purposes:
- Getters and setters for field data may take into account a schema map of field names.
- Mapping into struct fields of arbitrary depth using from→mystruct.mystruct.myfield
- Author:
- Vegard Havdal
-
Field Summary
Fields inherited from class com.yahoo.document.Document
classId, SERIALIZED_VERSION
-
Constructor Summary
ConstructorDescriptionProxyDocument
(DocumentProcessor docProc, com.yahoo.document.Document doc, Map<String, String> fieldMap) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
com.yahoo.document.Document
clone()
int
compareTo
(com.yahoo.document.datatypes.FieldValue fieldValue) void
deserialize
(com.yahoo.document.Field field, com.yahoo.document.serialization.FieldReader reader) void
deserialize
(com.yahoo.document.serialization.DocumentReader reader) protected void
doSetFieldValue
(com.yahoo.document.Field field, com.yahoo.document.datatypes.FieldValue value) boolean
com.yahoo.document.DocumentType
com.yahoo.document.Document
TheDocument
which this proxiescom.yahoo.document.Field
note that the returned Field may not be in this Document directly, but may refer to a field in a struct contained in it, in which case the returned Field is only useful for obtaining the field type; it can't be used for get() and set().int
com.yahoo.document.datatypes.FieldValue
getFieldValue
(com.yahoo.document.Field field) com.yahoo.document.datatypes.FieldValue
getFieldValue
(String fieldName) com.yahoo.document.DocumentId
getId()
int
com.yahoo.document.DocumentOperation
int
hashCode()
com.yahoo.document.datatypes.FieldPathIteratorHandler.ModificationStatus
iterateNested
(com.yahoo.document.FieldPath fieldPath, int pos, com.yahoo.document.datatypes.FieldPathIteratorHandler handler) iterator()
void
onSerialize
(com.yahoo.vespa.objects.Serializer target) void
printXml
(com.yahoo.document.serialization.XmlStream xml) com.yahoo.document.datatypes.FieldValue
removeFieldValue
(com.yahoo.document.Field field) com.yahoo.document.datatypes.FieldValue
removeFieldValue
(String fieldName) void
serialize
(com.yahoo.document.Field field, com.yahoo.document.serialization.FieldWriter writer) void
serialize
(com.yahoo.document.serialization.DocumentWriter writer) void
serialize
(OutputStream out) void
setDataType
(com.yahoo.document.DataType type) com.yahoo.document.datatypes.FieldValue
setFieldValue
(com.yahoo.document.Field field, com.yahoo.document.datatypes.FieldValue fieldValue) com.yahoo.document.datatypes.FieldValue
setFieldValue
(String fieldName, com.yahoo.document.datatypes.FieldValue fieldValue) void
setId
(com.yahoo.document.DocumentId id) void
setLastModified
(Long lastModified) toJson()
toString()
toXml()
Methods inherited from class com.yahoo.document.Document
createDocument, getApproxSize
Methods inherited from class com.yahoo.document.datatypes.StructuredFieldValue
isGenerated, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue
Methods inherited from class com.yahoo.document.datatypes.FieldValue
create, deserialize, getRecursiveValue, getRecursiveValue, getWrappedValue, onDeserialize, serialize
Methods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, onGetClassId, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, visitMembers
Methods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Constructor Details
-
ProxyDocument
public ProxyDocument(DocumentProcessor docProc, com.yahoo.document.Document doc, Map<String, String> fieldMap)
-
-
Method Details
-
getField
note that the returned Field may not be in this Document directly, but may refer to a field in a struct contained in it, in which case the returned Field is only useful for obtaining the field type; it can't be used for get() and set().- Overrides:
getField
in classcom.yahoo.document.Document
-
getFieldValue
- Overrides:
getFieldValue
in classcom.yahoo.document.datatypes.StructuredFieldValue
-
getFieldValue
public com.yahoo.document.datatypes.FieldValue getFieldValue(com.yahoo.document.Field field) - Overrides:
getFieldValue
in classcom.yahoo.document.Document
-
setFieldValue
public com.yahoo.document.datatypes.FieldValue setFieldValue(String fieldName, com.yahoo.document.datatypes.FieldValue fieldValue) - Overrides:
setFieldValue
in classcom.yahoo.document.datatypes.StructuredFieldValue
-
setFieldValue
public com.yahoo.document.datatypes.FieldValue setFieldValue(com.yahoo.document.Field field, com.yahoo.document.datatypes.FieldValue fieldValue) - Overrides:
setFieldValue
in classcom.yahoo.document.datatypes.StructuredFieldValue
-
removeFieldValue
- Overrides:
removeFieldValue
in classcom.yahoo.document.datatypes.StructuredFieldValue
-
removeFieldValue
public com.yahoo.document.datatypes.FieldValue removeFieldValue(com.yahoo.document.Field field) - Overrides:
removeFieldValue
in classcom.yahoo.document.Document
-
getWrappedDocumentOperation
public com.yahoo.document.DocumentOperation getWrappedDocumentOperation()- Specified by:
getWrappedDocumentOperation
in interfaceDocumentOperationWrapper
-
equals
- Overrides:
equals
in classcom.yahoo.document.Document
-
toString
- Overrides:
toString
in classcom.yahoo.document.Document
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.yahoo.document.Document
-
clone
public com.yahoo.document.Document clone()- Overrides:
clone
in classcom.yahoo.document.Document
-
clear
public void clear()- Overrides:
clear
in classcom.yahoo.document.Document
-
iterator
public Iterator<Map.Entry<com.yahoo.document.Field,com.yahoo.document.datatypes.FieldValue>> iterator()- Overrides:
iterator
in classcom.yahoo.document.Document
-
getId
public com.yahoo.document.DocumentId getId()- Overrides:
getId
in classcom.yahoo.document.Document
-
setLastModified
- Overrides:
setLastModified
in classcom.yahoo.document.Document
-
getLastModified
- Overrides:
getLastModified
in classcom.yahoo.document.Document
-
setId
public void setId(com.yahoo.document.DocumentId id) - Overrides:
setId
in classcom.yahoo.document.Document
-
assign
- Overrides:
assign
in classcom.yahoo.document.Document
-
setDataType
public void setDataType(com.yahoo.document.DataType type) - Overrides:
setDataType
in classcom.yahoo.document.Document
-
getSerializedSize
public int getSerializedSize() throws com.yahoo.document.serialization.SerializationException- Overrides:
getSerializedSize
in classcom.yahoo.document.Document
- Throws:
com.yahoo.document.serialization.SerializationException
-
serialize
public void serialize(OutputStream out) throws com.yahoo.document.serialization.SerializationException - Overrides:
serialize
in classcom.yahoo.document.Document
- Throws:
com.yahoo.document.serialization.SerializationException
-
doSetFieldValue
protected void doSetFieldValue(com.yahoo.document.Field field, com.yahoo.document.datatypes.FieldValue value) - Overrides:
doSetFieldValue
in classcom.yahoo.document.Document
-
toXML
- Overrides:
toXML
in classcom.yahoo.document.Document
-
toXml
- Overrides:
toXml
in classcom.yahoo.document.Document
-
printXml
public void printXml(com.yahoo.document.serialization.XmlStream xml) - Overrides:
printXml
in classcom.yahoo.document.Document
-
toJson
- Overrides:
toJson
in classcom.yahoo.document.Document
-
onSerialize
public void onSerialize(com.yahoo.vespa.objects.Serializer target) throws com.yahoo.document.serialization.SerializationException - Overrides:
onSerialize
in classcom.yahoo.document.Document
- Throws:
com.yahoo.document.serialization.SerializationException
-
getDataType
public com.yahoo.document.DocumentType getDataType()- Overrides:
getDataType
in classcom.yahoo.document.Document
-
getFieldCount
public int getFieldCount()- Overrides:
getFieldCount
in classcom.yahoo.document.Document
-
serialize
public void serialize(com.yahoo.document.serialization.DocumentWriter writer) - Overrides:
serialize
in classcom.yahoo.document.Document
-
deserialize
public void deserialize(com.yahoo.document.serialization.DocumentReader reader) - Overrides:
deserialize
in classcom.yahoo.document.Document
-
serialize
public void serialize(com.yahoo.document.Field field, com.yahoo.document.serialization.FieldWriter writer) - Overrides:
serialize
in classcom.yahoo.document.Document
-
deserialize
public void deserialize(com.yahoo.document.Field field, com.yahoo.document.serialization.FieldReader reader) - Overrides:
deserialize
in classcom.yahoo.document.Document
-
compareTo
public int compareTo(com.yahoo.document.datatypes.FieldValue fieldValue) - Specified by:
compareTo
in interfaceComparable<com.yahoo.document.datatypes.FieldValue>
- Overrides:
compareTo
in classcom.yahoo.document.Document
-
iterateNested
public com.yahoo.document.datatypes.FieldPathIteratorHandler.ModificationStatus iterateNested(com.yahoo.document.FieldPath fieldPath, int pos, com.yahoo.document.datatypes.FieldPathIteratorHandler handler) - Overrides:
iterateNested
in classcom.yahoo.document.datatypes.StructuredFieldValue
-
getDocument
public com.yahoo.document.Document getDocument()TheDocument
which this proxies- Returns:
- The proxied Document
-