public static class DefaultStyledDocument.ElementSpec extends Object
Element
s that should be
created in DefaultStyledDocument.ElementBuffer
. This allows the parsing process to be
decoupled from the Element
creation process.Modifier and Type | Field and Description |
---|---|
static short |
ContentType
This indicates a content element.
|
static short |
EndTagType
This indicates an end tag.
|
static short |
JoinFractureDirection
This indicates that the data associated with this spec should be joined
to the fractured element.
|
static short |
JoinNextDirection
This indicates that the data associated with this spec should be joined
with what follows it.
|
static short |
JoinPreviousDirection
This indicates that the data associated with this spec should be joined
with what precedes it.
|
static short |
OriginateDirection
This indicates that the data associated with this spec should be used to
create a new element.
|
static short |
StartTagType
This indicates a start tag.
|
Constructor and Description |
---|
DefaultStyledDocument.ElementSpec(AttributeSet a,
short type)
Creates a new
ElementSpec with no content, length or
offset. |
DefaultStyledDocument.ElementSpec(AttributeSet a,
short type,
char[] txt,
int offs,
int len)
Creates a new
ElementSpec with document content. |
DefaultStyledDocument.ElementSpec(AttributeSet a,
short type,
int len)
Creates a new
ElementSpec that specifies the length but
not the offset of an element. |
Modifier and Type | Method and Description |
---|---|
char[] |
getArray()
Returns the actual content of the element.
|
AttributeSet |
getAttributes()
Returns the attributes of the element.
|
short |
getDirection()
Returns the direction of the element.
|
int |
getLength()
Returns the length of the content.
|
int |
getOffset()
Returns the offset of the content.
|
short |
getType()
Returns the type of the element.
|
void |
setDirection(short dir)
Sets the direction of the element.
|
void |
setType(short type)
Sets the type of the element.
|
String |
toString()
Returns a String representation of this
ElementSpec
describing the type, direction and length of this
ElementSpec . |
public static final short StartTagType
getType()
.public static final short EndTagType
getType()
.public static final short ContentType
getType()
.public static final short JoinPreviousDirection
getDirection()
.public static final short JoinNextDirection
getDirection()
.public static final short OriginateDirection
getDirection()
.public static final short JoinFractureDirection
getDirection()
.public DefaultStyledDocument.ElementSpec(AttributeSet a, short type)
ElementSpec
with no content, length or
offset. This is most useful for start and end tags.a
- the attributes for the element to be createdtype
- the type of the tagpublic DefaultStyledDocument.ElementSpec(AttributeSet a, short type, int len)
ElementSpec
that specifies the length but
not the offset of an element. Such ElementSpec
s are
processed sequentially from a known starting point.a
- the attributes for the element to be createdtype
- the type of the taglen
- the length of the elementpublic DefaultStyledDocument.ElementSpec(AttributeSet a, short type, char[] txt, int offs, int len)
ElementSpec
with document content.a
- the attributes for the element to be createdtype
- the type of the tagtxt
- the actual contentoffs
- the offset into the txt
arraylen
- the length of the elementpublic void setType(short type)
type
- the type of the element to be setpublic short getType()
public void setDirection(short dir)
dir
- the direction of the element to be setpublic short getDirection()
public AttributeSet getAttributes()
public char[] getArray()
public int getOffset()
public int getLength()
public String toString()
ElementSpec
describing the type, direction and length of this
ElementSpec
.toString
in class Object
ElementSpec
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)