Class PropertyTextUnitPlaceholder

  • All Implemented Interfaces:
    Comparable<PropertyTextUnitPlaceholder>

    public class PropertyTextUnitPlaceholder
    extends Object
    implements Comparable<PropertyTextUnitPlaceholder>
    This class acts as a placeholder for both Propertys and ITextUnits that are found within tags. HTML and XML attributes are the canonical case. Along with the attribute name, value and type this class stores offset information for the name and value that can be used by the AbstractFilter to automatically generate proper attribute-based IResources
    • Constructor Detail

      • PropertyTextUnitPlaceholder

        public PropertyTextUnitPlaceholder​(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType,
                                           String name,
                                           String value,
                                           int mainStartPos,
                                           int mainEndPos,
                                           int valueStartPos,
                                           int valueEndPos)
        Constructor for Property and ITextUnit that are delimited by formatting (i.e., name="value"). The offset 'n' in name is the mainStartPos, the offset 'v' in value is the valueStartPos.
        Parameters:
        accessType - a PropertyTextUnitPlaceholder.PlaceholderAccessType
        name - attribute name
        value - attribute value
        mainStartPos - start offset of the value delimiter
        mainEndPos - end offset of the entire attribute
        valueStartPos - start offset of the value
        valueEndPos - ending offset of the value
    • Method Detail

      • getMainStartPos

        public int getMainStartPos()
        Get the offset to the beginning of the attribute.
        Returns:
        offset as int
      • setMainStartPos

        public void setMainStartPos​(int mainStartPos)
        Set the offset to the beginning of the attribute.
        Parameters:
        mainStartPos - the offset as integer
      • getMainEndPos

        public int getMainEndPos()
        Get the ending offset of the attribute
        Returns:
        offset as integer
      • setMainEndPos

        public void setMainEndPos​(int mainEndPos)
        Set the ending offset of the attribute
        Parameters:
        mainEndPos - the ending offset as an integer
      • setName

        public void setName​(String name)
        Set the attribute name
        Parameters:
        name - the attribute name
      • getName

        public String getName()
        Get the attribute name
        Returns:
        the attribute name
      • setValue

        public void setValue​(String value)
        Set the attribute value
        Parameters:
        value - the attribute value
      • getValue

        public String getValue()
        Get the attribute value
        Returns:
        the attribute value
      • getValueStartPos

        public int getValueStartPos()
        Get the starting offset of the attribute value.
        Returns:
        the starting offset as int
      • setValueStartPos

        public void setValueStartPos​(int valueStartPos)
        Set the starting offset of the attribute value.
        Parameters:
        valueStartPos - the start offset as int
      • getValueEndPos

        public int getValueEndPos()
        Get the ending offset of the attribute value
        Returns:
        the ending offset as int
      • setValueEndPos

        public void setValueEndPos​(int valueEndPos)
        Set the ending offset of the attribute value
        Parameters:
        valueEndPos - the ending offset as int
      • setMimeType

        public void setMimeType​(String mimeType)
        Set the attribute values mimetype
        Parameters:
        mimeType - the mimeType to set
      • getMimeType

        public String getMimeType()
        Get the attribute values mimetype
        Returns:
        the mimeType
      • setElementType

        public void setElementType​(String elementType)
      • getElementType

        public String getElementType()
      • equals

        public boolean equals​(Object aThat)
        Define equality of state. Equality is based on the MainStartPos of the attribute.
        Overrides:
        equals in class Object
        Parameters:
        aThat - the PropertyTextUnitPlaceholder that is compared to this object
      • hashCode

        public int hashCode()
        A class that overrides equals must also override hashCode. Return a hash code based on the MainStartPos only
        Overrides:
        hashCode in class Object