Class MappedField

  • Direct Known Subclasses:
    EphemeralMappedField

    public class MappedField
    extends java.lang.Object
    Deprecated.
    Developer note. This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
      Deprecated.
      Adds the annotation, if it exists on the field.
      void addAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> clazz, java.lang.annotation.Annotation ann)
      Deprecated.
      Adds the annotation, if it exists on the field.
      static void addInterestingAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
      Deprecated.
      Adds an annotation for Morphia to retain when mapping.
      protected void discover​(Mapper mapper)
      Deprecated.
      Discovers interesting (that we care about) things about the field.
      protected void discoverType​(Mapper mapper)
      Deprecated.
       
      <T extends java.lang.annotation.Annotation>
      T
      getAnnotation​(java.lang.Class<T> clazz)
      Deprecated.
       
      java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> getAnnotations()
      Deprecated.
       
      java.lang.Class getConcreteType()
      Deprecated.
       
      java.lang.reflect.Constructor getCTor()
      Deprecated.
       
      java.lang.Object getDbObjectValue​(com.mongodb.DBObject dbObj)
      Deprecated.
       
      java.lang.Class getDeclaringClass()
      Deprecated.
       
      java.lang.reflect.Field getField()
      Deprecated.
       
      java.lang.Object getFieldValue​(java.lang.Object instance)
      Deprecated.
      Gets the value of the field mapped on the instance given.
      java.lang.String getFirstFieldName​(com.mongodb.DBObject dbObj)
      Deprecated.
      Gets the field name to use when converting from a DBObject
      java.lang.String getFullName()
      Deprecated.
       
      java.lang.String getJavaFieldName()
      Deprecated.
       
      java.util.List<java.lang.String> getLoadNames()
      Deprecated.
       
      java.lang.Class getMapKeyClass()
      Deprecated.
      If the underlying java type is a map then it returns T from Map<T,V>
      java.lang.String getMappedFieldName()
      Deprecated.
       
      java.lang.String getNameToStore()
      Deprecated.
       
      java.lang.Class getSubClass()
      Deprecated.
      If the java field is a list/array/map then the sub-type T is returned (ex.
      java.lang.reflect.Type getSubType()
      Deprecated.
      If the java field is a list/array/map then the sub-type T is returned (ex.
      java.lang.Class getType()
      Deprecated.
       
      java.util.List<MappedField> getTypeParameters()
      Deprecated.
       
      boolean hasAnnotation​(java.lang.Class ann)
      Deprecated.
      Indicates whether the annotation is present in the mapping (does not check the java field annotations, just the ones discovered)
      protected java.util.List<java.lang.String> inferLoadNames()
      Deprecated.
       
      boolean isArray()
      Deprecated.
       
      boolean isMap()
      Deprecated.
       
      boolean isMultipleValues()
      Deprecated.
       
      boolean isReference()
      Deprecated.
       
      boolean isSet()
      Deprecated.
       
      boolean isSingleValue()
      Deprecated.
       
      boolean isTransient()
      Deprecated.
       
      boolean isTypeMongoCompatible()
      Deprecated.
       
      java.lang.annotation.Annotation putAnnotation​(java.lang.annotation.Annotation ann)
      Deprecated.
      unused
      void setFieldValue​(java.lang.Object instance, java.lang.Object value)
      Deprecated.
      Sets the value for the java field
      protected java.lang.Class toClass​(java.lang.reflect.Type t)
      Deprecated.
       
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • addInterestingAnnotation

        public static void addInterestingAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
        Deprecated.
        Adds an annotation for Morphia to retain when mapping.
        Parameters:
        annotation - the type to retain
      • addAnnotation

        public void addAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
        Deprecated.
        Adds the annotation, if it exists on the field.
        Parameters:
        clazz - the annotation to add
      • addAnnotation

        public void addAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> clazz,
                                  java.lang.annotation.Annotation ann)
        Deprecated.
        Adds the annotation, if it exists on the field.
        Parameters:
        clazz - type of the annotation
        ann - the annotation
      • getAnnotation

        public <T extends java.lang.annotation.Annotation> T getAnnotation​(java.lang.Class<T> clazz)
        Deprecated.
        Type Parameters:
        T - the type of the annotation
        Parameters:
        clazz - the annotation to search for
        Returns:
        the annotation instance if it exists on this field
      • getAnnotations

        public java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> getAnnotations()
        Deprecated.
        Returns:
        the annotations found while mapping
      • getCTor

        public java.lang.reflect.Constructor getCTor()
        Deprecated.
        Returns:
        a constructor for the type represented by the field
      • getConcreteType

        public java.lang.Class getConcreteType()
        Deprecated.
        Returns:
        the concrete type of the MappedField
      • getDbObjectValue

        public java.lang.Object getDbObjectValue​(com.mongodb.DBObject dbObj)
        Deprecated.
        Parameters:
        dbObj - the DBObject get the value from
        Returns:
        the value from best mapping of this field
      • getDeclaringClass

        public java.lang.Class getDeclaringClass()
        Deprecated.
        Returns:
        the declaring class of the java field
      • getField

        public java.lang.reflect.Field getField()
        Deprecated.
        Returns:
        the underlying java field
      • getFieldValue

        public java.lang.Object getFieldValue​(java.lang.Object instance)
        Deprecated.
        Gets the value of the field mapped on the instance given.
        Parameters:
        instance - the instance to use
        Returns:
        the value stored in the java field
      • getFirstFieldName

        public java.lang.String getFirstFieldName​(com.mongodb.DBObject dbObj)
        Deprecated.
        Gets the field name to use when converting from a DBObject
        Parameters:
        dbObj - the DBObject to scan for alternate names
        Returns:
        the value of this field mapped from the DBObject
        See Also:
        AlsoLoad
      • getFullName

        public java.lang.String getFullName()
        Deprecated.
        Returns:
        the full name of the class plus java field name
      • getJavaFieldName

        public java.lang.String getJavaFieldName()
        Deprecated.
        Returns:
        the name of the java field, as declared on the class
      • getLoadNames

        public java.util.List<java.lang.String> getLoadNames()
        Deprecated.
        Returns:
        the name of the field's (key)name for mongodb, in order of loading.
      • inferLoadNames

        protected java.util.List<java.lang.String> inferLoadNames()
        Deprecated.
      • getMapKeyClass

        public java.lang.Class getMapKeyClass()
        Deprecated.
        If the underlying java type is a map then it returns T from Map<T,V>
        Returns:
        the type of the map key
      • getNameToStore

        public java.lang.String getNameToStore()
        Deprecated.
        Returns:
        the name of the field's (key)name for mongodb
      • getSubClass

        public java.lang.Class getSubClass()
        Deprecated.
        If the java field is a list/array/map then the sub-type T is returned (ex. List<T>, T[], Map<?,T>
        Returns:
        the parameterized type of the field
      • getSubType

        public java.lang.reflect.Type getSubType()
        Deprecated.
        If the java field is a list/array/map then the sub-type T is returned (ex. List<T>, T[], Map<?,T>
        Returns:
        the parameterized type of the field
      • isTransient

        public boolean isTransient()
        Deprecated.
        Returns:
        true if this field is marked as transient
      • getType

        public java.lang.Class getType()
        Deprecated.
        Returns:
        the type of the underlying java field
      • getTypeParameters

        public java.util.List<MappedField> getTypeParameters()
        Deprecated.
        Returns:
        the type parameters defined on the field
      • hasAnnotation

        public boolean hasAnnotation​(java.lang.Class ann)
        Deprecated.
        Indicates whether the annotation is present in the mapping (does not check the java field annotations, just the ones discovered)
        Parameters:
        ann - the annotation to search for
        Returns:
        true if the annotation was found
      • isArray

        public boolean isArray()
        Deprecated.
        Returns:
        true if the MappedField is an array
      • isMap

        public boolean isMap()
        Deprecated.
        Returns:
        true if the MappedField is a Map
      • isMultipleValues

        public boolean isMultipleValues()
        Deprecated.
        Returns:
        true if this field is a container type such as a List, Map, Set, or array
      • isReference

        public boolean isReference()
        Deprecated.
        Returns:
        true if this field is a reference to a foreign document
        See Also:
        Reference, Key, DBRef
      • isSet

        public boolean isSet()
        Deprecated.
        Returns:
        true if the MappedField is a Set
      • isSingleValue

        public boolean isSingleValue()
        Deprecated.
        Returns:
        true if this field is not a container type such as a List, Map, Set, or array
      • isTypeMongoCompatible

        public boolean isTypeMongoCompatible()
        Deprecated.
        Returns:
        true if type is understood by MongoDB and the driver
      • putAnnotation

        @Deprecated
        public java.lang.annotation.Annotation putAnnotation​(java.lang.annotation.Annotation ann)
        Deprecated.
        unused
        Adds the annotation even if not on the declared class/field.
        Parameters:
        ann - the annotation to add
        Returns:
        ann the annotation
      • setFieldValue

        public void setFieldValue​(java.lang.Object instance,
                                  java.lang.Object value)
        Deprecated.
        Sets the value for the java field
        Parameters:
        instance - the instance to update
        value - the value to set
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object
      • discover

        protected void discover​(Mapper mapper)
        Deprecated.
        Discovers interesting (that we care about) things about the field.
      • discoverType

        protected void discoverType​(Mapper mapper)
        Deprecated.
      • getMappedFieldName

        public java.lang.String getMappedFieldName()
        Deprecated.
        Returns:
        the name of the field's key-name for mongodb
        Developer note. This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • toClass

        protected java.lang.Class toClass​(java.lang.reflect.Type t)
        Deprecated.