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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartprotected int index
MXMLData.public MXMLUnitData()
public MXMLUnitData(MXMLUnitData other)
public int getContentStart()
IMXMLUnitDataSourceLocation.getAbsoluteStart()
will return the junk punctuation, whereas getContentStart will get the
content inside the punctuation.getContentStart in interface IMXMLUnitDatapublic int getContentEnd()
IMXMLUnitDataIMXMLUnitData.getContentStart() for more.getContentEnd in interface IMXMLUnitDatapublic 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()
IMXMLUnitDataIMXMLUnitData which is the hierarchical parent of this
unit in its parents array of IMXMLUnitData objectsgetParentUnitData in interface IMXMLUnitDataIMXMLUnitData 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()
IMXMLUnitDatagetSource in interface IMXMLUnitDataIFileSpecification representing the source file.public final int getIndex()
IMXMLUnitDataIMXMLData.getIndex in interface IMXMLUnitDatapublic boolean isText()
IMXMLUnitDataisText in interface IMXMLUnitDatapublic boolean isTag()
IMXMLUnitDataisTag in interface IMXMLUnitDatapublic boolean isOpenTag()
IMXMLUnitDataisOpenTag in interface IMXMLUnitDatapublic boolean isOpenAndNotEmptyTag()
IMXMLUnitDataisOpenAndNotEmptyTag in interface IMXMLUnitDatapublic boolean isCloseTag()
IMXMLUnitDataisCloseTag in interface IMXMLUnitDatapublic final IMXMLData getParent()
IMXMLUnitDataIMXMLData representing the MXML document that contains
this unit.getParent in interface IMXMLUnitDataIMXMLData that contains this unit.public final IMXMLUnitData getPrevious()
IMXMLUnitDatagetPrevious in interface IMXMLUnitDatapublic final IMXMLUnitData getNext()
IMXMLUnitDatagetNext in interface IMXMLUnitDatapublic final IMXMLUnitData getNextSiblingUnit()
IMXMLUnitDatanull.getNextSiblingUnit in interface IMXMLUnitDatapublic final IMXMLTagData getNextTag()
IMXMLUnitDatagetNextTag in interface IMXMLUnitDatapublic boolean containsOffset(int offset)
IMXMLUnitDatacontainsOffset in interface IMXMLUnitDatapublic final IMXMLTagData getContainingTag(int offset)
IMXMLUnitDatagetContainingTag in interface IMXMLUnitDatapublic MXMLDialect getMXMLDialect()
IMXMLUnitDatagetMXMLDialect in interface IMXMLUnitDataMXMLDialect 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.