Interface MetaDataObject

    • Method Detail

      • listAttributes

        @Deprecated
        java.util.List<NameClassPair> listAttributes()
        Deprecated.
        - use getAttributes() instead, don't override it, use getAdditionalAttributes to specify additional ones
        Retrieves all attributes on this MetaDataObject.
        Returns:
        a List containing NameClassPair objects, each of which contains the name of a parameter and the Class of its value. For primitive types, the wrapper classes will be returned (e.g. java.lang.Integer instead of int).
      • getAttributeValue

        java.lang.Object getAttributeValue​(java.lang.String aName)
        Retrieves the value of an attribute of this MetaDataObject.
        Parameters:
        aName - the name of the parameter to get
        Returns:
        the value of the parameter named aName. Returns null if there is no attribute with that name.
      • isModifiable

        boolean isModifiable()
        Returns whether this MetaDataObject allows the values of its attributes to be modified.
        Returns:
        true if and only if this object's attributes may be modified.
      • setAttributeValue

        void setAttributeValue​(java.lang.String aName,
                               java.lang.Object aValue)
        Sets the value of an attribute of this MetaDataObject. Applications should first check the isModifiable() method; calling setAttributeValue(String, Object) on an unmodifiable MetaDataObject will result in an exception.
        Parameters:
        aName - the name of the parameter to set
        aValue - the value to assign to the parameter
        Throws:
        UIMA_UnsupportedOperationException - if this MetaDataObject is not modifiable.
        UIMA_IllegalArgumentException - if the given value is not appropriate for the given attribute.
      • clone

        java.lang.Object clone()
        Creates a clone of this MetaDataObject. This performs a "deep" copy by cloning all attribute values that are also MetaDataObjects.
        Returns:
        a clone of this MetaDataObject
      • equals

        boolean equals​(java.lang.Object aObj)
        Determines if this object is equal to another. Two MetaDataObjects are equal if they share the same attributes and the same values for those attributes.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        aObj - an object with which to compare this object
        Returns:
        true if and only if this object equals aObj
      • getSourceUrl

        java.net.URL getSourceUrl()
        Gets the URL from which this object was parsed. When this object is parsed from an XML file, this is set by the parser to the URL of the source file XML file. If the object has been created by some other method, the source URL will not be known, and this method will return null.

        This setting is used to resolve imports and is also included in exception messages to indicate the source of the problem.

        Returns:
        the source URL from which this object was parsed
      • getSourceUrlString

        java.lang.String getSourceUrlString()
        If the sourceURL of this object is non-null, returns its string representation. If it is null, returns "<unknown>". Useful for error messages.
        Returns:
        the source URL as a string, or "<unknown>"
      • setSourceUrl

        void setSourceUrl​(java.net.URL aUrl)
        Sets the URL from which this object was parsed. Typically only the XML parser sets this. This recursively sets the source URL of all descendants of this object.
        Parameters:
        aUrl - the location of the XML file from which this object was parsed