public class PropertyTextUnitPlaceholder extends Object implements Comparable<PropertyTextUnitPlaceholder>
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| Modifier and Type | Class and Description |
|---|---|
static class |
PropertyTextUnitPlaceholder.PlaceholderAccessType |
| Constructor and Description |
|---|
PropertyTextUnitPlaceholder(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType,
String name,
String value)
Constructor for
Property only. |
PropertyTextUnitPlaceholder(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType,
String name,
String value,
int valueStartPos,
int valueEndPos)
Constructor for
Property and ITextUnit without a main
offsets. |
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"). |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PropertyTextUnitPlaceholder aThat)
Compare two
PropertyTextUnitPlaceholders. |
boolean |
equals(Object aThat)
Define equality of state.
|
PropertyTextUnitPlaceholder.PlaceholderAccessType |
getAccessType()
Get the placeholder
PropertyTextUnitPlaceholder.PlaceholderAccessType. |
String |
getElementType() |
int |
getMainEndPos()
Get the ending offset of the attribute
|
int |
getMainStartPos()
Get the offset to the beginning of the attribute.
|
String |
getMimeType()
Get the attribute values mimetype
|
String |
getName()
Get the attribute name
|
String |
getValue()
Get the attribute value
|
int |
getValueEndPos()
Get the ending offset of the attribute value
|
int |
getValueStartPos()
Get the starting offset of the attribute value.
|
int |
hashCode()
A class that overrides equals must also override hashCode. Return
a hash code based on the MainStartPos only
|
void |
setAccessType(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType)
|
void |
setElementType(String elementType) |
void |
setMainEndPos(int mainEndPos)
Set the ending offset of the attribute
|
void |
setMainStartPos(int mainStartPos)
Set the offset to the beginning of the attribute.
|
void |
setMimeType(String mimeType)
Set the attribute values mimetype
|
void |
setName(String name)
Set the attribute name
|
void |
setValue(String value)
Set the attribute value
|
void |
setValueEndPos(int valueEndPos)
Set the ending offset of the attribute value
|
void |
setValueStartPos(int valueStartPos)
Set the starting offset of the attribute value.
|
public PropertyTextUnitPlaceholder(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType, String name, String value)
Property only. All offsets are the same, useful
for creating placeholders for read-only PropertysaccessType - a PropertyTextUnitPlaceholder.PlaceholderAccessTypename - attribute namevalue - attribute valuepublic PropertyTextUnitPlaceholder(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType, String name, String value, int valueStartPos, int valueEndPos)
Property and ITextUnit without a main
offsets. This is useful for cases where values are not delimited by any
formattingaccessType - a PropertyTextUnitPlaceholder.PlaceholderAccessTypename - attribute namevalue - attribute valuevalueStartPos - start offset of the valuevalueEndPos - ending offset of the valuepublic PropertyTextUnitPlaceholder(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType, String name, String value, int mainStartPos, int mainEndPos, int valueStartPos, int valueEndPos)
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.accessType - a PropertyTextUnitPlaceholder.PlaceholderAccessTypename - attribute namevalue - attribute valuemainStartPos - start offset of the value delimitermainEndPos - end offset of the entire attributevalueStartPos - start offset of the valuevalueEndPos - ending offset of the valuepublic PropertyTextUnitPlaceholder.PlaceholderAccessType getAccessType()
PropertyTextUnitPlaceholder.PlaceholderAccessType.public void setAccessType(PropertyTextUnitPlaceholder.PlaceholderAccessType accessType)
accessType - the type, one of TRANSLATABLE, READ_ONLY_PROPERTY,
WRITABLE_PROPERTYpublic int getMainStartPos()
public void setMainStartPos(int mainStartPos)
mainStartPos - the offset as integerpublic int getMainEndPos()
public void setMainEndPos(int mainEndPos)
mainEndPos - the ending offset as an integerpublic void setName(String name)
name - the attribute namepublic String getName()
public void setValue(String value)
value - the attribute valuepublic String getValue()
public int getValueStartPos()
public void setValueStartPos(int valueStartPos)
valueStartPos - the start offset as intpublic int getValueEndPos()
public void setValueEndPos(int valueEndPos)
valueEndPos - the ending offset as intpublic void setMimeType(String mimeType)
mimeType - the mimeType to setpublic String getMimeType()
public void setElementType(String elementType)
public String getElementType()
public int compareTo(PropertyTextUnitPlaceholder aThat)
PropertyTextUnitPlaceholders. Compare is based in
MainStartPos order only. Allows sorting of many
PropertyTextUnitPlaceholders in the order they appear in the
inputcompareTo in interface Comparable<PropertyTextUnitPlaceholder>aThat - the PropertyTextUnitPlaceholder used to compare to
this objectpublic boolean equals(Object aThat)
equals in class ObjectaThat - the PropertyTextUnitPlaceholder that is compared to
this objectCopyright © 2022. All rights reserved.