Class Schema

All Implemented Interfaces:
Archivable, RMJSONArchiver.GetKeys, RMPropertyChanger, Cloneable

public class Schema extends RMObject implements RMJSONArchiver.GetKeys, Archivable
This class describes the structure of a data source by managing a list of entities.
  • Constructor Details

    • Schema

      public Schema()
      Creates a new empty schema.
    • Schema

      public Schema(String aName)
      Creates a new schema with the given name.
  • Method Details

    • getName

      public String getName()
      Returns the name of the entity.
    • setName

      public void setName(String aName)
      Sets the name of the entity.
    • getSite

      public WebSite getSite()
      Returns the WebSite the schema works for.
    • setSite

      public void setSite(WebSite aSite)
      Sets the WebSite the schema works for.
    • getEntityCount

      public int getEntityCount()
      Returns the number of entities in this schema.
    • getEntity

      public Entity getEntity(int anIndex)
      Returns the specific entity at the given index.
    • getEntities

      public List<Entity> getEntities()
      Returns the list of entities.
    • setEntities

      public void setEntities(List<Entity> theEntities)
      Sets a list of entities.
    • addEntity

      public void addEntity(Entity anEntity)
      Adds an entity to the list.
    • addEntity

      public void addEntity(Entity anEntity, int anIndex)
      Adds an entity to the list.
    • removeEntity

      public Entity removeEntity(int anIndex)
      Removes an entity at given index.
    • removeEntity

      public int removeEntity(Entity anEntity)
      Removes an entity from the list.
    • getEntity

      public Entity getEntity(String aName)
      Returns the schema entity with the given name.
    • getRootEntity

      public Entity getRootEntity()
      Returns the root entity.
    • createRootEntity

      protected Entity createRootEntity()
      Creates a root entity.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • clone

      public Schema clone()
      Standard clone implementation.
      Overrides:
      clone in class RMListenerList
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface Archivable
    • fromXML

      public Schema fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface Archivable
    • getJSONKeys

      public List<String> getJSONKeys()
      Returns keys for JSON archival.
      Specified by:
      getJSONKeys in interface RMJSONArchiver.GetKeys
    • toString

      public String toString()
      Returns schema name.
      Overrides:
      toString in class RMObject