org.spicefactory.pimento.metamodel.impl
Class MetamodelImpl

java.lang.Object
  extended by org.spicefactory.pimento.metamodel.impl.MetamodelImpl
All Implemented Interfaces:
Externalizable, Metamodel
Direct Known Subclasses:
TypeHierarchy

public class MetamodelImpl
extends Object
implements Metamodel, Externalizable

Default implementation of the Metamodel interface.

Author:
Jens Halm

Constructor Summary
MetamodelImpl()
           
 
Method Summary
 void add(Entity entity)
          Adds the specified entity to the metamodel.
 Entity forClass(Class<?> type)
          Returns the entity metamodel for the specified persistent type.
 Entity forHandle(int handle)
          Returns the entity metamodel for the specified type handle.
 Collection<Entity> getEntities()
          Return all entity metamodels managed by this instance.
 void readExternal(DataInput in)
          Restores the content of this object from the DataInput instance.
 void writeExternal(DataOutput out)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetamodelImpl

public MetamodelImpl()
Method Detail

add

public void add(Entity entity)
Adds the specified entity to the metamodel.

Parameters:
entity - the entity to add to the metamodel

forClass

public Entity forClass(Class<?> type)
Description copied from interface: Metamodel
Returns the entity metamodel for the specified persistent type.

Specified by:
forClass in interface Metamodel
Parameters:
type - the persistent type to retrieve the metamodel for
Returns:
the entity metamodel for the specified persistent type

forHandle

public Entity forHandle(int handle)
Description copied from interface: Metamodel
Returns the entity metamodel for the specified type handle. Type handles are usually only used internally. To save bandwidth Pimento uses a numeric identifier for an entity type instead of passing class names.

Specified by:
forHandle in interface Metamodel
Parameters:
handle - the type handle to retrieve the metamodel for
Returns:
the entity metamodel for the specified type handle

getEntities

public Collection<Entity> getEntities()
Description copied from interface: Metamodel
Return all entity metamodels managed by this instance.

Specified by:
getEntities in interface Metamodel
Returns:
all entity metamodels managed by this instance.

writeExternal

public void writeExternal(DataOutput out)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - the output to write to

readExternal

public void readExternal(DataInput in)
Description copied from interface: Externalizable
Restores the content of this object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Specified by:
readExternal in interface Externalizable
Parameters:
in - the AMF3 data to read from