Class AbstractSchema<S extends Schema<S>>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.refcodes.mixin.AbstractSchema<S>
Type Parameters:
S - The actual type of the Schema being implemented (usually an implemented Schema does not require any type parameters any more).
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, ChildrenAccessor<Schema<S>[]>, Schema<S>, TypeAccessor

public abstract class AbstractSchema<S extends Schema<S>> extends HashMap<String,Object> implements Schema<S>
The purpose of a AbstractSchema is automatically generate documentation of nested data structures.
See Also:
  • Constructor Details

    • AbstractSchema

      public AbstractSchema(Class<?> aType, String aDescription)
      Constructs a AbstractSchema with the provided arguments.
      Parameters:
      aDescription - The description of the schema described by the AbstractSchema providing type.
      aType - The type providing the this AbstractSchema instance.
    • AbstractSchema

      public AbstractSchema(Class<?> aType, String aDescription, S... aChildren)
      Constructs a AbstractSchema with the provided arguments.
      Parameters:
      aDescription - The description of the schema described by the AbstractSchema providing type.
      aType - The type providing the this AbstractSchema instance.
      aChildren - The children's AbstractSchema descriptions representing part of the AbstractSchema providing type.
    • AbstractSchema

      public AbstractSchema(Class<?> aType, String aAlias, String aDescription, S... aChildren)
      Constructs a AbstractSchema with the provided arguments.
      Parameters:
      aAlias - The alias (name) of the schema described by the AbstractSchema providing type.
      aDescription - The description of the schema described by the AbstractSchema providing type.
      aType - The type providing the this AbstractSchema instance.
      aChildren - The children's AbstractSchema descriptions representing part of the AbstractSchema providing type.
    • AbstractSchema

      public AbstractSchema(Class<?> aType, String aAlias, String aDescription)
      Constructs a AbstractSchema with the provided arguments.
      Parameters:
      aAlias - The alias (name) of the schema described by the AbstractSchema providing type.
      aDescription - The description of the schema described by the AbstractSchema providing type.
      aType - The type providing the this AbstractSchema instance.
    • AbstractSchema

      public AbstractSchema(S aSchema)
      Constructs a AbstractSchema with the properties of the provided AbstractSchema ("copy constructor"),.
      Parameters:
      aSchema - The AbstractSchema from which to copy the attributes.
    • AbstractSchema

      public AbstractSchema(S aSchema, Class<?> aType)
      Constructs a AbstractSchema with the provided arguments.
      Parameters:
      aSchema - The AbstractSchema from which to copy the attributes.
      aType - The type providing the this AbstractSchema instance.
    • AbstractSchema

      public AbstractSchema(S aSchema, S... aChildren)
      Constructs a AbstractSchema with the properties of the provided AbstractSchema ("copy constructor"),.
      Parameters:
      aSchema - The AbstractSchema from which to copy the attributes.
      aChildren - The children's AbstractSchema descriptions representing part of the AbstractSchema providing type.
  • Method Details

    • getChildren

      public S[] getChildren()
      Retrieves the children from the children property.
      Specified by:
      getChildren in interface ChildrenAccessor<S extends Schema<S>>
      Specified by:
      getChildren in interface Schema<S extends Schema<S>>
      Returns:
      The children stored by the children property.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractMap<String,Object>
    • toString

      protected String toString(Object aValue)
      Hook method for converting a type to an according String.
      Parameters:
      aValue - The value of a given type to be converted accordingly.
      Returns:
      The accordingly converted value.
    • getType

      public Class<?> getType()
      Description copied from interface: TypeAccessor
      Retrieves the type property.
      Specified by:
      getType in interface TypeAccessor<S extends Schema<S>>
      Returns:
      The type stored by the property.