Interface Annotation

    • Field Detail

      • PROPERTY

        static final ChangeType PROPERTY
        This type symbolizes that one or more properties have changed.
      • EMPTY_ANNOTATION

        static final Annotation EMPTY_ANNOTATION

        A really useful empty and immutable annotation object.

        Be careful when stooring Annotation arguments to constructors. It is possible that you have been passed EMPTY_ANNOTATION but that code later on will access this object believing it to be mutable. For example, the SeqIO factory code clones some Annotations passed in on Feature.Template instances Use this instead of null when you really don't want an object or an implementation to have annotation even though it should implement Annotatable.
    • Method Detail

      • getProperty

        Object getProperty​(Object key)
                    throws NoSuchElementException

        Retrieve the value of a property by key.

        Unlike the Map collections, it will complain if the key does not exist. It will only return null if the key is defined and has value null.

        Normal raw access to the property. For cleverer access, use methods in AnnotationType.
        Parameters:
        key - the key of the property to retrieve
        Returns:
        the object associated with that key
        Throws:
        NoSuchElementException - if there is no property with the key
      • setProperty

        void setProperty​(Object key,
                         Object value)
                  throws IllegalArgumentException,
                         ChangeVetoException

        Set the value of a property.

        This method throws an exception if either properties can not be added to this object, or that this particular property is immutable or illegal within the implementation.

        Normal raw access to the property. For cleverer access, use methods in AnnotationType.
        Parameters:
        key - the key object
        value - the new value for this key
        Throws:
        IllegalArgumentException - if the property key is not legal
        ChangeVetoException - if this annotation object can't be changed, or if the change was vetoed.
      • containsProperty

        boolean containsProperty​(Object key)
        Returns whether there the property is defined. Normal raw access to the property. For cleverer access, use methods in AnnotationType.
        Parameters:
        key - the key Object to search for
        Returns:
        true if this Annotation knows about the key, false otherwise
      • keys

        Set keys()
        Get a set of key objects.
        Returns:
        a Set of key objects
      • asMap

        Map asMap()
        Return a map that contains the same key/values as this Annotation.

        If the annotation changes, the map may not reflect this. The Map may be unmodifiable.

        Returns:
        a Map