Interface Detail

  • All Known Implementing Classes:
    DefaultDetail, DetailScanner

    interface Detail
    The Detail object is used to provide various details for a type. Most of the data that can be acquired from this can also be acquired from the Class. However, in some environments, particularly Android, reflection and introspection is very slow. This class attempts to reduce the overheads by caching all the data extracted from the class for future use.
    See Also:
    Support
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DefaultType getAccess()
      This returns the Default annotation access type that has been specified by this.
      java.lang.annotation.Annotation[] getAnnotations()
      This returns the annotations that have been declared for this type.
      java.lang.reflect.Constructor[] getConstructors()
      This returns the constructors that have been declared for this type.
      java.util.List<FieldDetail> getFields()
      This returns a list of the fields that belong to this type.
      java.util.List<MethodDetail> getMethods()
      This returns a list of the methods that belong to this type.
      java.lang.String getName()
      This returns the name of the class represented by this detail.
      Namespace getNamespace()
      This returns the Namespace annotation that was declared on the type.
      NamespaceList getNamespaceList()
      This returns the NamespaceList annotation that was declared on the type.
      Order getOrder()
      This returns the order annotation used to determine the order of serialization of attributes and elements.
      DefaultType getOverride()
      This returns the DefaultType override used for this detail.
      Root getRoot()
      This returns the Root annotation for the class.
      java.lang.Class getSuper()
      This is used to acquire the super type for the class that is represented by this detail.
      java.lang.Class getType()
      This returns the type represented by this detail.
      boolean isInstantiable()
      This is used to determine if the class is an inner class.
      boolean isPrimitive()
      This is used to determine whether this detail represents a primitive type.
      boolean isRequired()
      This is used to determine if the generated annotations are required or not.
      boolean isStrict()
      This method is used to determine whether strict mappings are required.
    • Method Detail

      • isStrict

        boolean isStrict()
        This method is used to determine whether strict mappings are required. Strict mapping means that all labels in the class schema must match the XML elements and attributes in the source XML document. When strict mapping is disabled, then XML elements and attributes that do not exist in the schema class will be ignored without breaking the parser.
        Returns:
        true if strict parsing is enabled, false otherwise
      • isRequired

        boolean isRequired()
        This is used to determine if the generated annotations are required or not. By default generated parameters are required. Setting this to false means that null values are accepted by all defaulted fields or methods depending on the type.
        Returns:
        this is used to determine if defaults are required
      • isInstantiable

        boolean isInstantiable()
        This is used to determine if the class is an inner class. If the class is a inner class and not static then this returns false. Only static inner classes can be instantiated using reflection as they do not require a "this" argument.
        Returns:
        this returns true if the class is a static inner
      • isPrimitive

        boolean isPrimitive()
        This is used to determine whether this detail represents a primitive type. A primitive type is any type that does not extend Object, examples are int, long and double.
        Returns:
        this returns true if no XML annotations were found
      • getSuper

        java.lang.Class getSuper()
        This is used to acquire the super type for the class that is represented by this detail. If the super type for the class is Object then this will return null.
        Returns:
        returns the super type for this class or null
      • getType

        java.lang.Class getType()
        This returns the type represented by this detail. The type is the class that has been scanned for annotations, methods and fields. All super types of this are represented in the detail.
        Returns:
        the type that this detail object represents
      • getName

        java.lang.String getName()
        This returns the name of the class represented by this detail. The name is either the name as specified in the last found Root annotation, or if a name was not specified within the discovered root then the Java Bean class name of the last class annotated with a root annotation.
        Returns:
        this returns the name of the object being scanned
      • getRoot

        Root getRoot()
        This returns the Root annotation for the class. The root determines the type of deserialization that is to be performed and also contains the name of the root element.
        Returns:
        this returns the name of the object being scanned
      • getOrder

        Order getOrder()
        This returns the order annotation used to determine the order of serialization of attributes and elements. The order is a class level annotation that can be used only once per class XML schema. If none exists then this will return null. of the class processed by this scanner.
        Returns:
        this returns the name of the object being scanned
      • getAccess

        DefaultType getAccess()
        This returns the Default annotation access type that has been specified by this. If no default annotation has been declared on the type then this will return null.
        Returns:
        this returns the default access type for this type
      • getOverride

        DefaultType getOverride()
        This returns the DefaultType override used for this detail. An override is used only when the class contains no annotations and does not have a Transform of any type associated with it. It allows serialization of external objects without the need to annotate the types.
        Returns:
        this returns the access type override for this type
      • getNamespace

        Namespace getNamespace()
        This returns the Namespace annotation that was declared on the type. If no annotation has been declared on the type this will return null as not belonging to any.
        Returns:
        this returns the namespace this type belongs to, if any
      • getNamespaceList

        NamespaceList getNamespaceList()
        This returns the NamespaceList annotation that was declared on the type. A list of namespaces are used to simply declare the namespaces without specifically making the type belong to any of the declared namespaces.
        Returns:
        this returns the namespace declarations, if any
      • getMethods

        java.util.List<MethodDetail> getMethods()
        This returns a list of the methods that belong to this type. The methods here do not include any methods from the super types and simply provides a means of caching method data.
        Returns:
        returns the list of methods declared for the type
      • getFields

        java.util.List<FieldDetail> getFields()
        This returns a list of the fields that belong to this type. The fields here do not include any fields from the super types and simply provides a means of caching method data.
        Returns:
        returns the list of fields declared for the type
      • getAnnotations

        java.lang.annotation.Annotation[] getAnnotations()
        This returns the annotations that have been declared for this type. It is preferable to acquire the declared annotations from this method as they are cached. Older versions of some runtime environments, particularly Android, are slow at this.
        Returns:
        this returns the annotations associated with this
      • getConstructors

        java.lang.reflect.Constructor[] getConstructors()
        This returns the constructors that have been declared for this type. It is preferable to acquire the declared constructors from this method as they are cached. Older versions of some runtime environments, particularly Android, are slow at this.
        Returns:
        this returns the constructors associated with this