Class Property

  • All Implemented Interfaces:
    Cloneable

    public class Property
    extends Object
    implements Cloneable
    Represents a read-only or a modifiable property associated with a resource. For example the HREF attribute of the element A in HTML would be a property. Note that translatable data (such as the text of an attribute ALT of an IMG element in HTML) must be stored in TextUnit rather that Property.
    • Constructor Detail

      • Property

        public Property​(String name,
                        String value,
                        boolean isReadOnly)
        Creates a new property object with a name, a vale and its read-only flag.
        Parameters:
        name - the name of the property (case-sensitive).
        value - the value of the property.
        isReadOnly - true if the property cannot be modified using the filter, false if you can modify the value in the output document.
      • Property

        public Property​(String name,
                        String value)
        Creates a new read-only property object with a name and a value.
        Parameters:
        name - the name of the property (case-sensitive)
        value - the value of the property.
    • Method Detail

      • toString

        public String toString()
        Gets the string representation of this property. This is the same as its value.
        Overrides:
        toString in class Object
        Returns:
        the value of the property.
      • clone

        public Property clone()
        Clones this property.
        Overrides:
        clone in class Object
        Returns:
        a new property object that is a copy of this one.
      • getName

        public String getName()
        Gets the name of this property.
        Returns:
        the name of this property.
      • setName

        protected void setName​(String name)
      • getValue

        public String getValue()
        Gets the value of this property.
        Returns:
        the value of this property.
      • setValue

        public void setValue​(String value)
        Sets a new value for this property.
        Parameters:
        value - the new value to set.
      • getBoolean

        public boolean getBoolean()
        Gets the boolean value of this property. Use this helper method to get a boolean from the value of this property. The values "true" and "yes" (in any case) returns true, any other value returns false. No verification is done to see if the value is really boolean or not.
        Returns:
        true is the property value is "true", "yes" (case-insensitive), false otherwise.
      • isReadOnly

        public boolean isReadOnly()
        Indicates if this property is read-only.

        All property can be changed, but the ones flagged as read-only cannot be modified when re-writing the document from where they have been extracted.

        Returns:
        true if the property cannot be modified in the filter output, false if it can be modified.
      • setReadOnly

        protected void setReadOnly​(boolean isReadOnly)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object