public static class FeatureTypes.RepositoryImpl extends AbstractChangeable implements FeatureTypes.Repository
Annotatable.AnnotationForwarderANNOTATION| Constructor and Description |
|---|
RepositoryImpl(java.lang.String name)
Create a named repository.
|
| Modifier and Type | Method and Description |
|---|---|
FeatureTypes.Type |
createType(java.lang.String name,
FeatureFilter schema,
java.util.Set parents)
Create a new type in this repository.
|
Annotation |
getAnnotation()
Should return the associated annotation object.
|
protected ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object.
|
java.lang.String |
getName()
The name of this repository.
|
FeatureTypes.Type |
getType(java.lang.String name)
Find the type for a name.
|
java.util.Set |
getTypes()
Get a set of all type names defined in this repository.
|
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic RepositoryImpl(java.lang.String name)
name - the name of this repositoryprotected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to
be transient and lazily instantiated. Be sure to register & unregister the
forwarder in the code that does the ChangeEvent handling in setter methods.
ChangeSupport cs = super.getChangeSupport(ct);
if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
someForwarder = new ChangeForwarder(...
this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
}
return cs;
getChangeSupport in class AbstractChangeablepublic Annotation getAnnotation()
AnnotatablegetAnnotation in interface Annotatablepublic java.lang.String getName()
FeatureTypes.RepositoryThe name of this repository.
This will be the ${repository} component of any URIs of types defined here.
getName in interface FeatureTypes.Repositorypublic java.util.Set getTypes()
FeatureTypes.RepositorygetTypes in interface FeatureTypes.Repositorypublic FeatureTypes.Type getType(java.lang.String name) throws java.util.NoSuchElementException
FeatureTypes.RepositorygetType in interface FeatureTypes.Repositoryname - the name of the Typejava.util.NoSuchElementException - if that type can not be foundpublic FeatureTypes.Type createType(java.lang.String name, FeatureFilter schema, java.util.Set parents)
name - the Type nameschema - the FeatureFilter defining the typeparents - the Set (possibly empty) of parent URIs