Class FeatureTypes.RepositoryImpl

    • Constructor Detail

      • RepositoryImpl

        public RepositoryImpl​(java.lang.String name)
        Create a named repository.
        Parameters:
        name - the name of this repository
    • Method Detail

      • getChangeSupport

        protected ChangeSupport getChangeSupport​(ChangeType ct)
        Description copied from class: AbstractChangeable
        Called to retrieve the ChangeSupport for this object.

        Your implementation of this method should have the following structure:

         ChangeSupport cs = super.getChangeSupport(ct);
        
         if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
           someForwarder = new ChangeForwarder(...
        
           this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
         }
        
         return cs;
         
        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.
        Overrides:
        getChangeSupport in class AbstractChangeable
      • getAnnotation

        public Annotation getAnnotation()
        Description copied from interface: Annotatable
        Should return the associated annotation object.
        Specified by:
        getAnnotation in interface Annotatable
        Returns:
        an Annotation object, never null
      • getName

        public java.lang.String getName()
        Description copied from interface: FeatureTypes.Repository

        The name of this repository.

        This will be the ${repository} component of any URIs of types defined here.

        Specified by:
        getName in interface FeatureTypes.Repository
        Returns:
        the name of the repository
      • getType

        public FeatureTypes.Type getType​(java.lang.String name)
                                  throws java.util.NoSuchElementException
        Description copied from interface: FeatureTypes.Repository
        Find the type for a name.
        Specified by:
        getType in interface FeatureTypes.Repository
        Parameters:
        name - the name of the Type
        Returns:
        the Type of that name
        Throws:
        java.util.NoSuchElementException - if that type can not be found
      • createType

        public FeatureTypes.Type createType​(java.lang.String name,
                                            FeatureFilter schema,
                                            java.util.Set parents)
        Create a new type in this repository.
        Parameters:
        name - the Type name
        schema - the FeatureFilter defining the type
        parents - the Set (possibly empty) of parent URIs