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 voidaddEntity(Entity anEntity)Adds an entity to the list.voidaddEntity(Entity anEntity, int anIndex)Adds an entity to the list.Schemaclone()Standard clone implementation.protected EntitycreateRootEntity()Creates a root entity.booleanequals(java.lang.Object anObj)Standard equals implementation.SchemafromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.java.util.List<Entity>getEntities()Returns the list of entities.EntitygetEntity(int anIndex)Returns the specific entity at the given index.EntitygetEntity(java.lang.String aName)Returns the schema entity with the given name.intgetEntityCount()Returns the number of entities in this schema.java.util.List<java.lang.String>getJSONKeys()Returns keys for JSON archival.java.lang.StringgetName()Returns the name of the entity.EntitygetRootEntity()Returns the root entity.WebSitegetSite()Returns the WebSite the schema works for.EntityremoveEntity(int anIndex)Removes an entity at given index.intremoveEntity(Entity anEntity)Removes an entity from the list.voidsetEntities(java.util.List<Entity> theEntities)Sets a list of entities.voidsetName(java.lang.String aName)Sets the name of the entity.voidsetSite(WebSite aSite)Sets the WebSite the schema works for.java.lang.StringtoString()Returns schema name.RXElementtoXML(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:
equalsin classjava.lang.Object
-
clone
public Schema clone()
Standard clone implementation.- Overrides:
clonein classRMListenerList
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Specified by:
toXMLin interfaceArchivable
-
fromXML
public Schema fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXMLin interfaceArchivable
-
getJSONKeys
public java.util.List<java.lang.String> getJSONKeys()
Returns keys for JSON archival.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
-