Class AbstractSchema

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.refcodes.mixin.AbstractSchema
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, AliasAccessor, ChildrenAccessor<Schema[]>, DescriptionAccessor, Schema, TypeAccessor

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

    • AbstractSchema

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

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

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

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

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

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

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

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

    • getChildren

      public Schema[] getChildren()
      Retrieves the children from the children property.
      Specified by:
      getChildren in interface ChildrenAccessor<Schema[]>
      Specified by:
      getChildren in interface Schema
      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.