public class BufferedElement extends Object implements IBufferedRegion
BufferedElement
children.| Modifier and Type | Field and Description |
|---|---|
protected BufferedEndTagElement |
endTagElement |
protected BufferedStartTagElement |
startTagElement |
| Constructor and Description |
|---|
BufferedElement(BufferedElement parent,
String uri,
String localName,
String name,
Attributes attributes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRegion(ISavable region)
Add a savable region in the current tag element.
|
void |
append(char c)
Append content in the current tag element.
|
void |
append(char[] ch,
int start,
int length)
Append content in the current tag element.
|
void |
append(String content)
Append content in the current tag element.
|
void |
end()
Set the current buffer with end tag element.
|
BufferedElement |
findChildAt(BufferedElement element,
String name,
int index)
Returns the first child element of this element which match the given
name and null otherwise.
|
BufferedElement |
findChildAt(String name,
int index)
Returns the first child element of the given element which match the
given name and null otherwise.
|
List<BufferedElement> |
findChildren(BufferedElement element,
String name)
Returns the children element of the given element which match the given
name.
|
List<BufferedElement> |
findChildren(String name)
Returns the children element of this element which match the given name.
|
BufferedElement |
findFirstChild(BufferedElement element,
String name)
Returns the first child element of this element which match the given
name and null otherwise.
|
BufferedElement |
findFirstChild(String name)
Returns the first child element of the given element which match the
given name and null otherwise.
|
BufferedElement |
findParent(BufferedElement element,
String name)
Returns the parent element of the given element which match the given
name.
|
BufferedElement |
findParent(String name)
Returns the parent element of this element which match the given name.
|
String |
get(String key) |
Attributes |
getAttributes()
Returns the static SAX attributes.
|
BufferedEndTagElement |
getEndTagElement()
Returns the buffer of the end tag element.
|
String |
getEndTagElementName()
Returns the name of this end tag element (ex : ).
|
String |
getInnerText() |
String |
getName() |
BufferedElement |
getOwnerElement()
Returns the owner element.
|
BufferedElement |
getParent()
Returns the parent buffered element of this element.
|
BufferedStartTagElement |
getStartTagElement()
Returns the buffer of the start tag element.
|
String |
getStartTagElementName()
Returns the name of this start tag element (ex :
|
String |
getTextContent()
Returns the text content for this element.
|
boolean |
isEnded()
Returns true if current buffer is end tag element and false otherwise.
|
boolean |
isReseted() |
boolean |
isString()
Returns false
|
boolean |
match(String name)
Returns true if the given name match the name of this element and false
otherwise.
|
void |
put(String key,
String value) |
void |
registerDynamicAttributes()
Register dynamic attributes if needed.
|
void |
removeAll(Collection<BufferedElement> elements)
Remove the collection of element.
|
void |
reset()
Reset the whole content of the element.
|
void |
save(Writer writer)
Write the content of this element in the given writer.
|
BufferedAttribute |
setAttribute(String name,
String value)
Set dynamic attribute.
|
void |
setContentAfterEndTagElement(String after)
Set content on the after end tag element.
|
void |
setContentBeforeStartTagElement(String before)
Set content on the before start tag element.
|
void |
setInnerText(String innerText) |
void |
setTextContent(String content)
Set text content for this element.
|
void |
start()
Set the current buffer with start tag element.
|
String |
toString() |
protected final BufferedStartTagElement startTagElement
protected final BufferedEndTagElement endTagElement
public BufferedElement(BufferedElement parent, String uri, String localName, String name, Attributes attributes)
public boolean match(String name)
name - public BufferedStartTagElement getStartTagElement()
public BufferedEndTagElement getEndTagElement()
public void setContentBeforeStartTagElement(String before)
before - public void setContentAfterEndTagElement(String after)
before - public BufferedElement getParent()
getParent in interface IBufferedRegionpublic void save(Writer writer) throws IOException
save in interface ISavableIOExceptionpublic void addRegion(ISavable region)
addRegion in interface IBufferedRegionpublic boolean isString()
isString in interface IBufferedRegionpublic void append(String content)
append in interface IBufferedRegionpublic void append(char[] ch,
int start,
int length)
append in interface IBufferedRegionpublic void append(char c)
append in interface IBufferedRegionpublic void reset()
public boolean isReseted()
public void removeAll(Collection<BufferedElement> elements)
elements - public BufferedElement getOwnerElement()
getOwnerElement in interface ISavablepublic BufferedElement findParent(String name)
element - name - public BufferedElement findParent(BufferedElement element, String name)
element - name - public List<BufferedElement> findChildren(String name)
name - public List<BufferedElement> findChildren(BufferedElement element, String name)
element - name - public BufferedElement findFirstChild(String name)
name - public BufferedElement findFirstChild(BufferedElement element, String name)
name - public BufferedElement findChildAt(String name, int index)
name - public BufferedElement findChildAt(BufferedElement element, String name, int index)
name - public void start()
public void end()
public boolean isEnded()
public String getStartTagElementName()
public String getEndTagElementName()
public void setTextContent(String content)
content - public String getTextContent()
public Attributes getAttributes()
public void registerDynamicAttributes()
public BufferedAttribute setAttribute(String name, String value)
name - value - public String getName()
public String getInnerText()
public void setInnerText(String innerText)
Copyright © 2015. All Rights Reserved.