Class Schema
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.snap.data.Schema
-
- All Implemented Interfaces:
Archivable
,RMJSONArchiver.GetKeys
,RMPropertyChanger
,java.lang.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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntity(Entity anEntity)
Adds an entity to the list.void
addEntity(Entity anEntity, int anIndex)
Adds an entity to the list.Schema
clone()
Standard clone implementation.protected Entity
createRootEntity()
Creates a root entity.boolean
equals(java.lang.Object anObj)
Standard equals implementation.Schema
fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.java.util.List<Entity>
getEntities()
Returns the list of entities.Entity
getEntity(int anIndex)
Returns the specific entity at the given index.Entity
getEntity(java.lang.String aName)
Returns the schema entity with the given name.int
getEntityCount()
Returns the number of entities in this schema.java.util.List<java.lang.String>
getJSONKeys()
Returns keys for JSON archival.java.lang.String
getName()
Returns the name of the entity.Entity
getRootEntity()
Returns the root entity.WebSite
getSite()
Returns the WebSite the schema works for.Entity
removeEntity(int anIndex)
Removes an entity at given index.int
removeEntity(Entity anEntity)
Removes an entity from the list.void
setEntities(java.util.List<Entity> theEntities)
Sets a list of entities.void
setName(java.lang.String aName)
Sets the name of the entity.void
setSite(WebSite aSite)
Sets the WebSite the schema works for.java.lang.String
toString()
Returns schema name.RXElement
toXML(RXArchiver anArchiver)
XML archival.-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the entity.
-
setName
public void setName(java.lang.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 java.util.List<Entity> getEntities()
Returns the list of entities.
-
setEntities
public void setEntities(java.util.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(java.lang.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(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equals
in classjava.lang.Object
-
clone
public Schema clone()
Standard clone implementation.- Overrides:
clone
in classRMListenerList
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Specified by:
toXML
in interfaceArchivable
-
fromXML
public Schema fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-
getJSONKeys
public java.util.List<java.lang.String> getJSONKeys()
Returns keys for JSON archival.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
-