ch.akuhn.fame
Class MetaRepository

java.lang.Object
  extended by ch.akuhn.fame.Repository
      extended by ch.akuhn.fame.MetaRepository

public class MetaRepository
extends Repository

A meta-model (ie elements conforming to FM3).

Author:
Adrian Kuhn, 2007-2008

Constructor Summary
MetaRepository()
           
MetaRepository(MetaRepository metamodel)
           
 
Method Summary
 void add(Object element)
           
 void addClassDescription(Class<? extends Object> cls, MetaDescription desc)
           
 Collection<MetaDescription> allClassDescriptions()
           
 Collection<PackageDescription> allPackageDescriptions()
           
 Collection<PropertyDescription> allPropertyDescriptions()
           
 Warnings checkConstraints()
           
static MetaRepository createFM3()
           
 MetaDescription descriptionNamed(String fullName)
           
 MetaDescription getDescription(Class jclass)
          Returns the Fame-class to which the given Java-class is connected in this metammodel.
 PackageDescription initializePackageNamed(String name)
           
 boolean isSelfDescribed()
           
static boolean isValidElementName(String string)
           
static boolean isValidName(String string)
           
 void setImmutable()
           
 void with(Class jclass)
          Processes the annotations of the given Java-class, creates an according Fame-class and establishes a Scenario-II connection between both.
 void withAll(Class... jclasses)
          Processes all given Java-classes.
 
Methods inherited from class ch.akuhn.fame.Repository
accept, add, addAll, all, descriptionOf, exportMSE, exportMSE, fullname, getElements, getMetamodel, importMSE, importMSE, importMSE, isEmpty, newInstance, read, size, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaRepository

public MetaRepository()

MetaRepository

public MetaRepository(MetaRepository metamodel)
Method Detail

createFM3

public static MetaRepository createFM3()

isValidElementName

public static boolean isValidElementName(String string)

isValidName

public static boolean isValidName(String string)

add

public void add(Object element)
Overrides:
add in class Repository

addClassDescription

public void addClassDescription(Class<? extends Object> cls,
                                MetaDescription desc)

allClassDescriptions

public Collection<MetaDescription> allClassDescriptions()

allPackageDescriptions

public Collection<PackageDescription> allPackageDescriptions()

allPropertyDescriptions

public Collection<PropertyDescription> allPropertyDescriptions()

checkConstraints

public Warnings checkConstraints()

descriptionNamed

public MetaDescription descriptionNamed(String fullName)

getDescription

public MetaDescription getDescription(Class jclass)
Returns the Fame-class to which the given Java-class is connected in this metammodel.

Parameters:
jclass - a causally connected Java-class.
Returns:
a causally connected Fame-class.
Throws:
AssertionError - if the Java-class is not connected to any Fame-class in this metammodel.
See Also:
with(Class)

initializePackageNamed

public PackageDescription initializePackageNamed(String name)

isSelfDescribed

public boolean isSelfDescribed()

setImmutable

public void setImmutable()

with

public void with(Class jclass)
Processes the annotations of the given Java-class, creates an according Fame-class and establishes a Scenario-II connection between both. If such a connection is already present, nothing is done.

Parameters:
jclass - an annotated Java-class
Throws:
AssertionError - if the Java-class is not annotated.
See Also:
FameDescription, FamePackage, FameProperty

withAll

public void withAll(Class... jclasses)
Processes all given Java-classes.

Parameters:
jclasses - some annotated Java-classes.
Throws:
AssertionError - if any o fthe Java-classes is not annotated.
See Also:
with(Class)