public abstract class MXMLUnitData extends SourceLocation implements IMXMLUnitData
An MXMLData
object stores a linear list of MXML units, but it is
possible to walk them in a hierarchical way.
Modifier and Type | Field and Description |
---|---|
protected int |
index
This position of this unit in the linear list of units owned by the
MXMLData . |
UNKNOWN
Constructor and Description |
---|
MXMLUnitData()
Constructor.
|
MXMLUnitData(MXMLUnitData other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
adjustOffsets(int offsetAdjustment)
Adjust all associated offsets by the adjustment amount
|
String |
buildDumpString(boolean skipSrcPath) |
boolean |
containsOffset(int offset)
Does this unit contain the given offset (excluding start and including
end)?
|
IMXMLTagData |
getContainingTag(int offset)
Get the nearest containing tag.
|
int |
getContentEnd()
Returns the offset after the last character of actual content.
|
int |
getContentStart()
Returns the first character of the actual content of the unit For most
units this is the same as getStart(), but for things like tags which have
"junk punctuation" around them,
SourceLocation.getAbsoluteStart()
will return the junk punctuation, whereas getContentStart will get the
content inside the punctuation. |
int |
getIndex()
Get this unit's position in the
IMXMLData . |
MXMLDialect |
getMXMLDialect()
Returns the MXML dialect used in the MXML document that contains this
unit.
|
IMXMLUnitData |
getNext()
Gets the next MXML unit.
|
IMXMLUnitData |
getNextSiblingUnit()
Gets the next sibling unit after this unit.
|
IMXMLTagData |
getNextTag()
Gets the next tag.
|
IMXMLData |
getParent()
Gets the
IMXMLData representing the MXML document that contains
this unit. |
IMXMLUnitData |
getParentUnitData()
Gets the
IMXMLUnitData which is the hierarchical parent of this
unit in its parents array of IMXMLUnitData objects |
int |
getParentUnitDataIndex()
Gets the index of this tags hierarchical parent in its parents array of
MXMLUnitData objects
|
IMXMLUnitData |
getPrevious()
Gets the previous MXML unit.
|
IFileSpecification |
getSource()
Gets the source file that contains this unit.
|
protected String |
getTypeString() |
boolean |
isCloseTag()
Is this MXML unit an close tag?
|
boolean |
isOpenAndNotEmptyTag()
Is this MXML unit an open tag and not an empty tag (i.e. only
<foo>, not <foo;/>)?
|
boolean |
isOpenTag()
Is this MXML unit an open tag?
|
boolean |
isTag()
Is this MXML unit a tag?
|
boolean |
isText()
Is this MXML unit a block of text?
|
void |
setLocation(MXMLData parent,
int index)
Set this unit's position relative to its parent.
|
void |
setOffsets(int start,
int end)
Set this unit's start and end offsets.
|
void |
setParentUnitDataIndex(int parentIndex)
Sets the index of this tags hierarchical parent in its parents array of
MXMLUnitData objects
|
String |
toDumpString()
For debugging only.
|
boolean |
verify()
Verifies that this unit has its source location information set.
|
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, getStart, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, span, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
protected int index
MXMLData
.public MXMLUnitData()
public MXMLUnitData(MXMLUnitData other)
public int getContentStart()
IMXMLUnitData
SourceLocation.getAbsoluteStart()
will return the junk punctuation, whereas getContentStart will get the
content inside the punctuation.getContentStart
in interface IMXMLUnitData
public int getContentEnd()
IMXMLUnitData
IMXMLUnitData.getContentStart()
for more.getContentEnd
in interface IMXMLUnitData
public void setLocation(MXMLData parent, int index)
parent
- MXML file containing the unitindex
- this unit's position in the listpublic void setParentUnitDataIndex(int parentIndex)
parentIndex
- The index of the parent tag.public final IMXMLUnitData getParentUnitData()
IMXMLUnitData
IMXMLUnitData
which is the hierarchical parent of this
unit in its parents array of IMXMLUnitData objectsgetParentUnitData
in interface IMXMLUnitData
IMXMLUnitData
or null
.public final int getParentUnitDataIndex()
public void setOffsets(int start, int end)
start
- start offsetend
- end offsetpublic void adjustOffsets(int offsetAdjustment)
offsetAdjustment
- amount to add to offsetspublic final IFileSpecification getSource()
IMXMLUnitData
getSource
in interface IMXMLUnitData
IFileSpecification
representing the source file.public final int getIndex()
IMXMLUnitData
IMXMLData
.getIndex
in interface IMXMLUnitData
public boolean isText()
IMXMLUnitData
isText
in interface IMXMLUnitData
public boolean isTag()
IMXMLUnitData
isTag
in interface IMXMLUnitData
public boolean isOpenTag()
IMXMLUnitData
isOpenTag
in interface IMXMLUnitData
public boolean isOpenAndNotEmptyTag()
IMXMLUnitData
isOpenAndNotEmptyTag
in interface IMXMLUnitData
public boolean isCloseTag()
IMXMLUnitData
isCloseTag
in interface IMXMLUnitData
public final IMXMLData getParent()
IMXMLUnitData
IMXMLData
representing the MXML document that contains
this unit.getParent
in interface IMXMLUnitData
IMXMLData
that contains this unit.public final IMXMLUnitData getPrevious()
IMXMLUnitData
getPrevious
in interface IMXMLUnitData
public final IMXMLUnitData getNext()
IMXMLUnitData
getNext
in interface IMXMLUnitData
public final IMXMLUnitData getNextSiblingUnit()
IMXMLUnitData
null
.getNextSiblingUnit
in interface IMXMLUnitData
public final IMXMLTagData getNextTag()
IMXMLUnitData
getNextTag
in interface IMXMLUnitData
public boolean containsOffset(int offset)
IMXMLUnitData
containsOffset
in interface IMXMLUnitData
public final IMXMLTagData getContainingTag(int offset)
IMXMLUnitData
getContainingTag
in interface IMXMLUnitData
public MXMLDialect getMXMLDialect()
IMXMLUnitData
getMXMLDialect
in interface IMXMLUnitData
MXMLDialect
object.protected String getTypeString()
public String toDumpString()
public String buildDumpString(boolean skipSrcPath)
public boolean verify()
This is used only in asserts.
Copyright © 2016 The Apache Software Foundation. All rights reserved.