Class FieldValue

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int classId  
    • Constructor Summary

      Constructors 
      Constructor Description
      FieldValue()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void assign​(java.lang.Object o)
      Assign this non-fieldvalue value to this field value.
      abstract void clear()  
      FieldValue clone()  
      int compareTo​(FieldValue fieldValue)  
      static FieldValue create​(FieldReader reader, DataType type)  
      abstract void deserialize​(Field field, FieldReader reader)
      Read a field value from the specified reader
      void deserialize​(FieldReader reader)
      Read data from the given buffer to create this field value.
      abstract DataType getDataType()  
      FieldValue getRecursiveValue​(FieldPath path)  
      FieldValue getRecursiveValue​(java.lang.String path)
      Using the given field path, digs through the document and returns the matching field value.
      java.lang.Object getWrappedValue()
      Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values.
      void onDeserialize​(com.yahoo.vespa.objects.Deserializer data)  
      void onSerialize​(com.yahoo.vespa.objects.Serializer target)  
      abstract void printXml​(XmlStream xml)  
      abstract void serialize​(Field field, FieldWriter writer)
      Write out field value to the specified writer
      void serialize​(com.yahoo.io.GrowableByteBuffer buf)  
      java.lang.String toXml()
      Get XML representation of a single field and all its children, if any.
      • Methods inherited from class com.yahoo.vespa.objects.Identifiable

        create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, equals, getClassId, getUtf8, hashCode, onGetClassId, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, toString, visitMembers
      • Methods inherited from class com.yahoo.vespa.objects.Selectable

        select, select, selectMembers
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • classId

        public static final int classId
    • Constructor Detail

      • FieldValue

        public FieldValue()
    • Method Detail

      • getDataType

        public abstract DataType getDataType()
      • toXml

        public java.lang.String toXml()
        Get XML representation of a single field and all its children, if any.
        Returns:
        XML representation of field in a <value> element
      • deserialize

        public final void deserialize​(FieldReader reader)
        Read data from the given buffer to create this field value. As some field values have their type self contained, we need the type manager object to be able to retrieve it.
      • serialize

        public final void serialize​(com.yahoo.io.GrowableByteBuffer buf)
      • printXml

        public abstract void printXml​(XmlStream xml)
      • clear

        public abstract void clear()
      • clone

        public FieldValue clone()
        Overrides:
        clone in class com.yahoo.vespa.objects.Identifiable
      • assign

        public abstract void assign​(java.lang.Object o)
        Assign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.

        Override to accept the specific types that should be legal.

        Throws:
        java.lang.IllegalArgumentException - If the object given is of wrong type for this field value.
      • getWrappedValue

        public java.lang.Object getWrappedValue()
        Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values. Complex types that can't be specified by simple java types just return themself.
      • getRecursiveValue

        public FieldValue getRecursiveValue​(java.lang.String path)
        Using the given field path, digs through the document and returns the matching field value. If the field path resolves to multiple values, returns an ArrayFieldValue containing the values.
      • onSerialize

        public void onSerialize​(com.yahoo.vespa.objects.Serializer target)
        Overrides:
        onSerialize in class com.yahoo.vespa.objects.Identifiable
      • onDeserialize

        public void onDeserialize​(com.yahoo.vespa.objects.Deserializer data)
        Overrides:
        onDeserialize in class com.yahoo.vespa.objects.Identifiable
      • serialize

        public abstract void serialize​(Field field,
                                       FieldWriter writer)
        Write out field value to the specified writer
      • deserialize

        public abstract void deserialize​(Field field,
                                         FieldReader reader)
        Read a field value from the specified reader
      • compareTo

        public int compareTo​(FieldValue fieldValue)
        Specified by:
        compareTo in interface java.lang.Comparable<FieldValue>