Class ClassFieldDescription

    • Constructor Detail

      • ClassFieldDescription

        public ClassFieldDescription​(java.lang.Class<?> referenceClass,
                                     boolean fullScan)
        This should be called only once with the root class as an argument
        Parameters:
        referenceClass - the root node containing further Field children
        fullScan - true if the class field should be serialised according to Serializable (ie. object's non-static and non-transient fields); false otherwise.
      • ClassFieldDescription

        protected ClassFieldDescription​(java.lang.Class<?> referenceClass,
                                        java.lang.reflect.Field field,
                                        ClassFieldDescription parent,
                                        int recursionLevel)
      • ClassFieldDescription

        public ClassFieldDescription​(java.lang.reflect.Field field,
                                     ClassFieldDescription parent,
                                     int recursionLevel,
                                     boolean fullScan)
        This should be called for individual class field members
        Parameters:
        field - Field reference for the given class member
        parent - pointer to the root/parent reference class field description
        recursionLevel - hierarchy level (i.e. '0' being the root class, '1' the sub-class etc.
        fullScan - true if the class field should be serialised according to Serializable (ie. object's non-static and non-transient fields); false otherwise.
    • Method Detail

      • allocateMemberClassField

        public java.lang.Object allocateMemberClassField​(java.lang.Object fieldParent)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getActualTypeArgumentNames

        public java.util.List<java.lang.String> getActualTypeArgumentNames()
        Returns:
        generic type argument name of the class (e.g. for List<String> this would return 'java.lang.String')
      • getActualTypeArguments

        public java.util.List<java.lang.reflect.Type> getActualTypeArguments()
        Returns:
        generic type argument objects of the class (e.g. for List<String> this would return 'String.class')
      • getDataSize

        public int getDataSize()
        Specified by:
        getDataSize in interface FieldDescription
        Returns:
        the data size in bytes stored after the field header
      • getDataStartOffset

        public int getDataStartOffset()
        Specified by:
        getDataStartOffset in interface FieldDescription
        Returns:
        the offset in bytes from the field start position until the first data object can be read. (N.B. equals to 'getFieldstart() + getDataOffset()', the data ends at 'getDataStartOffset() + getDataSize()'
      • getDataStartPosition

        public int getDataStartPosition()
        Specified by:
        getDataStartPosition in interface FieldDescription
        Returns:
        the buffer byte position from where the first data object can be read
      • getFieldDescription

        public java.lang.String getFieldDescription()
        Specified by:
        getFieldDescription in interface FieldDescription
        Returns:
        optional meta data tag describing the purpose of this data field (N.B. can be empty String)
      • getFieldDirection

        public java.lang.String getFieldDirection()
        Description copied from interface: FieldDescription
        Return optional meta data tag describing the 'direction' of this data field. The information encodes the source servicedevelopers intend to the receiving user whether the field can be, for example, modified (get/set), set-only, or read-only, or attach any other similar information. Encoding/interpretation is left ad-lib to the source service developer.
        Specified by:
        getFieldDirection in interface FieldDescription
        Returns:
        optional meta data (N.B. can be empty String).
      • getFieldGroups

        public java.util.List<java.lang.String> getFieldGroups()
        Specified by:
        getFieldGroups in interface FieldDescription
        Returns:
        optional meta data tag describing the group/set this data field belongs to (N.B. can be empty String, corresponding to 'all')
      • getFieldName

        public java.lang.String getFieldName()
        Specified by:
        getFieldName in interface FieldDescription
        Returns:
        the underlying field name
      • getFieldNameHashCode

        public int getFieldNameHashCode()
        Specified by:
        getFieldNameHashCode in interface FieldDescription
        Returns:
        the data field name's hashcode (N.B. used for faster identification of the field)
      • getFieldNameRelative

        public java.lang.String getFieldNameRelative()
        Returns:
        relative field name within class hierarchy (ie. field_level0.field_level1.variable_0)
      • getFieldStart

        public int getFieldStart()
        Specified by:
        getFieldStart in interface FieldDescription
        Returns:
        buffer position in byte where the data field header starts
      • getFieldUnit

        public java.lang.String getFieldUnit()
        Specified by:
        getFieldUnit in interface FieldDescription
        Returns:
        optional meta data tag describing the field's SI unit or similar (N.B. can be empty String)
      • getGenericFieldTypeString

        public java.lang.String getGenericFieldTypeString()
        Returns:
        field type strings (e.g. for the class Map<Integer,String> this returns '<java.lang.Integer,java.lang.String>'
      • getGenericFieldTypeStringSimple

        public java.lang.String getGenericFieldTypeStringSimple()
        Returns:
        field type strings (e.g. for the class Map<Integer,String> this returns '<java.lang.Integer,java.lang.String>'
      • getGenericType

        public java.lang.reflect.Type getGenericType()
      • getHierarchyDepth

        public int getHierarchyDepth()
        Returns:
        hierarchy level depth w.r.t. root object (ie. '0' being a variable in the root object)
      • getModifierID

        public int getModifierID()
        Returns:
        the modifierID
      • getModifierString

        public java.lang.String getModifierString()
        Returns:
        the full modifier string (cached)
      • getParent

        public FieldDescription getParent​(FieldDescription field,
                                          int hierarchyLevel)
        Parameters:
        field - class Field description for which
        hierarchyLevel - the recursion level of the parent (e.g. '1' yields the immediate parent, '2' the parent of the parent etc.)
        Returns:
        the parent field reference description for the provided field
      • getType

        public java.lang.reflect.Type getType()
        Specified by:
        getType in interface FieldDescription
        Returns:
        field class type
      • getTypeName

        public java.lang.String getTypeName()
        Returns:
        field class type name
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isAbstract

        public boolean isAbstract()
        Returns:
        the isAbstract
      • isClass

        public boolean isClass()
        Returns:
        the isClass
      • isEnum

        public boolean isEnum()
        Returns:
        whether class is an Enum type
      • isFinal

        public boolean isFinal()
        Returns:
        true if the class field includes the final modifier; false otherwise.
      • isInterface

        public boolean isInterface()
        Returns:
        true if the class field is an interface
      • isNative

        public boolean isNative()
        Returns:
        the isNative
      • isPrimitive

        public boolean isPrimitive()
        Returns:
        true if the class field is a primitive type (ie. boolean, byte, ..., int, float, double)
      • isPrivate

        public boolean isPrivate()
        Returns:
        true if the class field includes the private modifier; false otherwise.
      • isProtected

        public boolean isProtected()
        Returns:
        the isProtected
      • isPublic

        public boolean isPublic()
        Returns:
        true if the class field includes the public modifier; false otherwise.
      • isRoot

        public boolean isRoot()
        Returns:
        the isRoot
      • isSerializable

        public boolean isSerializable()
        Returns:
        true if the class field should be serialised according to Serializable (ie. object's non-static and non-transient fields); false otherwise.
      • isStatic

        public boolean isStatic()
        Returns:
        true if the class field includes the static modifier; false otherwise.
      • isStrict

        public boolean isStrict()
        Returns:
        true if the class field includes the strictfp modifier; false otherwise.
      • isSynchronized

        public boolean isSynchronized()
        Returns:
        true if the class field includes the synchronized modifier; false otherwise.
      • isTransient

        public boolean isTransient()
        Returns:
        true if the class field includes the transient modifier; false otherwise.
      • isVolatile

        public boolean isVolatile()
        Returns:
        true if the class field includes the volatile modifier; false otherwise.
      • setFieldSerialiser

        public void setFieldSerialiser​(FieldSerialiser<?> fieldSerialiser)
      • toString

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

        protected static void exploreClass​(java.lang.Class<?> classType,
                                           ClassFieldDescription parent,
                                           int recursionLevel,
                                           boolean fullScan)
      • printClassStructure

        protected static void printClassStructure​(ClassFieldDescription field,
                                                  boolean fullView,
                                                  int recursionLevel)