Class ProfileImpl

  • All Implemented Interfaces:
    Map<Name,​AttributeType>, Schema

    public class ProfileImpl
    extends Object
    implements Schema
    A "sub" Schema used to select types for a specific use.

    This class uses a custom key set to subset a parent Schema, and is used as the return type of SchemaImpl.profile.

    This Schema is not mutable, serving only as a view, you may however define a more specific subset if needed.

    Schema is often used to place limitation on expressed content (as in the case of the GML Level 0 Profile), or used to define a non conflicting set of "bindings" for the TypeBuilder(s).

    Author:
    Jody Garnett, Refractions Research Inc.
    • Constructor Detail

      • ProfileImpl

        public ProfileImpl​(Schema parent,
                           Set<Name> profile)
        Subset parent schema with profile keys.
    • Method Detail

      • getURI

        public String getURI()
        Description copied from interface: Schema
        The uri of the schema.

        This method is a convenience for keySet().getURI().

        Specified by:
        getURI in interface Schema
        Returns:
        The uri of the schema.
      • profile

        public Schema profile​(Set<Name> profile)
        Description copied from interface: Schema
        Profiles the schema, creating a new schema in the process.

        A profile of a schema is a subset of the schema, and it also a schema itself.

        Used to select a subset of types for a specific application. Profiles often are used to express limitiations of a source of data.

        Specified by:
        profile in interface Schema
        Parameters:
        profile - The set of names which corresond to entries that will make up the profile.
        Returns:
        The profile of the original schema.
      • size

        public int size()
        Specified by:
        size in interface Map<Name,​AttributeType>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<Name,​AttributeType>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<Name,​AttributeType>
      • containsValue

        public boolean containsValue​(Object value)
        Specified by:
        containsValue in interface Map<Name,​AttributeType>
      • clear

        public void clear()
        Specified by:
        clear in interface Map<Name,​AttributeType>
      • add

        public void add​(AttributeType type)
        Description copied from interface: Schema
        Adds a type to the schema.

        This method is a convenience for put(type.getName(),type).

        Specified by:
        add in interface Schema
        Parameters:
        type - The type to add.