Class BufferedElement
java.lang.Object
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedElement
- All Implemented Interfaces:
IBufferedRegion,ISavable
- Direct Known Subclasses:
BufferedDocument,RowBufferedRegion,TableBufferedRegion
Buffered element which stores start Tag element (ex: ) and end Tag element
(ex: ). The start Tag element stores too the
BufferedElement
children.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BufferedEndTagElementprotected final BufferedStartTagElement -
Constructor Summary
ConstructorsConstructorDescriptionBufferedElement(BufferedElement parent, String uri, String localName, String name, Attributes attributes) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a savable region in the current tag element.voidappend(char c) Append content in the current tag element.voidappend(char[] ch, int start, int length) Append content in the current tag element.voidAppend content in the current tag element.voidend()Set the current buffer with end tag element.findChildAt(BufferedElement element, String name, int index) Returns the first child element of this element which match the given name and null otherwise.findChildAt(String name, int index) Returns the first child element of the given element which match the given name and null otherwise.findChildren(BufferedElement element, String name) Returns the children element of the given element which match the given name.findChildren(String name) Returns the children element of this element which match the given name.findFirstChild(BufferedElement element, String name) Returns the first child element of this element which match the given name and null otherwise.findFirstChild(String name) Returns the first child element of the given element which match the given name and null otherwise.findParent(BufferedElement element, String name) Returns the parent element of the given element which match the given name.findParent(String name) Returns the parent element of this element which match the given name.Returns the static SAX attributes.Returns the buffer of the end tag element.Returns the name of this end tag element (ex : </w:t>).getName()Returns the owner element.Returns the parent buffered element of this element.Returns the buffer of the start tag element.Returns the name of this start tag element (ex : <w:t>).Returns the text content for this element.booleanisEnded()Returns true if current buffer is end tag element and false otherwise.booleanbooleanisString()Returns falsebooleanReturns true if the given name match the name of this element and false otherwise.voidvoidRegister dynamic attributes if needed.voidremoveAll(Collection<BufferedElement> elements) Remove the collection of element.voidreset()Reset the whole content of the element.voidWrite the content of this element in the given writer.setAttribute(String name, String value) Set dynamic attribute.voidSet content on the after end tag element.voidSet content on the before start tag element.voidsetInnerText(String innerText) voidsetTextContent(String content) Set text content for this element.voidstart()Set the current buffer with start tag element.toString()
-
Field Details
-
startTagElement
-
endTagElement
-
-
Constructor Details
-
BufferedElement
public BufferedElement(BufferedElement parent, String uri, String localName, String name, Attributes attributes)
-
-
Method Details
-
match
Returns true if the given name match the name of this element and false otherwise.- Parameters:
name-- Returns:
-
getStartTagElement
Returns the buffer of the start tag element.- Returns:
-
getEndTagElement
Returns the buffer of the end tag element.- Returns:
-
setContentBeforeStartTagElement
Set content on the before start tag element.- Parameters:
before-
-
setContentAfterEndTagElement
Set content on the after end tag element.- Parameters:
before-
-
getParent
Returns the parent buffered element of this element.- Specified by:
getParentin interfaceIBufferedRegion- Returns:
-
save
Write the content of this element in the given writer.- Specified by:
savein interfaceISavable- Throws:
IOException
-
addRegion
Add a savable region in the current tag element.- Specified by:
addRegionin interfaceIBufferedRegion
-
isString
public boolean isString()Returns false- Specified by:
isStringin interfaceIBufferedRegion- Returns:
-
append
Append content in the current tag element.- Specified by:
appendin interfaceIBufferedRegion
-
append
public void append(char[] ch, int start, int length) Append content in the current tag element.- Specified by:
appendin interfaceIBufferedRegion
-
append
public void append(char c) Append content in the current tag element.- Specified by:
appendin interfaceIBufferedRegion
-
reset
public void reset()Reset the whole content of the element. -
isReseted
public boolean isReseted() -
removeAll
Remove the collection of element.- Parameters:
elements-
-
toString
-
getOwnerElement
Returns the owner element.- Specified by:
getOwnerElementin interfaceISavable- Returns:
-
findParent
Returns the parent element of this element which match the given name.- Parameters:
element-name-- Returns:
-
findParent
Returns the parent element of the given element which match the given name.- Parameters:
element-name-- Returns:
-
findChildren
Returns the children element of this element which match the given name.- Parameters:
name-- Returns:
-
findChildren
Returns the children element of the given element which match the given name.- Parameters:
element-name-- Returns:
-
findFirstChild
Returns the first child element of the given element which match the given name and null otherwise.- Parameters:
name-- Returns:
-
findFirstChild
Returns the first child element of this element which match the given name and null otherwise.- Parameters:
name-- Returns:
-
findChildAt
Returns the first child element of the given element which match the given name and null otherwise.- Parameters:
name-- Returns:
-
findChildAt
Returns the first child element of this element which match the given name and null otherwise.- Parameters:
name-- Returns:
-
start
public void start()Set the current buffer with start tag element. -
end
public void end()Set the current buffer with end tag element. -
isEnded
public boolean isEnded()Returns true if current buffer is end tag element and false otherwise.- Returns:
-
getStartTagElementName
Returns the name of this start tag element (ex : <w:t>).- Returns:
-
getEndTagElementName
Returns the name of this end tag element (ex : </w:t>).- Returns:
-
setTextContent
Set text content for this element.- Parameters:
content-
-
getTextContent
Returns the text content for this element.- Returns:
-
getAttributes
Returns the static SAX attributes.- Returns:
-
registerDynamicAttributes
public void registerDynamicAttributes()Register dynamic attributes if needed. -
setAttribute
Set dynamic attribute.- Parameters:
name-value-- Returns:
-
getName
-
getInnerText
-
setInnerText
-
get
-
put
-