Interface Element
- All Known Implementing Classes:
AbstractElement, AttributeAliasElement, BeanElement, DefaultElement, DefaultElementBodyCharacters, DefaultElementBodyComment, DefaultElementBodyWhitespace, DescriptionElement, ElementClassAddParentElement, ELReferenceElement, MethodElement, ModuleElement, NextAttributeElement, ParentObjectElement, PropertyElement, SkipPhaseElement
public interface Element
Defines an XML element with an object.
The main function is to store the ElementObject.
Also we can configure the ElementObject from differted events hooks. from the attibutes or parent (object)element.
The main function is to store the ElementObject.
Also we can configure the ElementObject from differted events hooks. from the attibutes or parent (object)element.
- Version:
- 1.0 Feb 01, 2005
- Author:
- Willem Cazander
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe ElementTypes which are possible. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an Elment as child of this element.voiddoCharacters(String body) Sets the body texts on an event based system.voidSets the comment texts on an event based system.voidThis method is fired when the end xml tag is parsed.voidThis method is fired only once in the run phase.voidThis method is fired when the start of xml tag is parsed.voiddoIgnorableWhitespace(String space) Is called when there is whitespace in xml.Gets the childeren elements including those which are comment and white space.Gets the xml attributes.Gets the childeren elements.Gets the ElementClass.Gives back the object this Element has made and configed.
So other elements can do stuff to that object.Gets the Element type.Gets the X4OLanguageSession.Returns the parent Element.
Or null when there is no parent Element.booleanReturns if this elements transforms the tree.voidrelease()This method get called when this Element object is not needed anymore.
Can be used to close resources.voidremoveChild(Element element) Removes an Elment as child of this element.voidsetAttribute(String name, String value) Sets the xml attributes.voidsetElementClass(ElementClass elementClass) Sets the ElementClass.voidsetElementObject(Object object) Sets the object which we control.voidsetLanguageSession(X4OLanguageSession languageSession) Sets the X4OLanguageSession.voidSet the parent Element.
-
Method Details
-
doElementEnd
This method is fired when the end xml tag is parsed.- Throws:
ElementException- Can be thrown when structure is not correct.
-
doElementStart
This method is fired when the start of xml tag is parsed.- Throws:
ElementException- Can be thrown when structure is not correct.
-
doElementRun
This method is fired only once in the run phase.- Throws:
ElementException- Can be thrown when structure is not correct.
-
setParent
Set the parent Element.- Parameters:
element- The paraent Element to set.
-
getParent
Element getParent()Returns the parent Element.
Or null when there is no parent Element.- Returns:
- Returns the parent Element
-
release
This method get called when this Element object is not needed anymore.
Can be used to close resources.- Throws:
ElementException- Can be thrown when structure is not correct.
-
getElementObject
Object getElementObject()Gives back the object this Element has made and configed.
So other elements can do stuff to that object.- Returns:
- An Object.
-
setElementObject
Sets the object which we control.- Parameters:
object- The object to configed by this element.
-
setLanguageSession
Sets the X4OLanguageSession.- Parameters:
languageSession- The X4OLanguageSession to set.
-
getLanguageSession
X4OLanguageSession getLanguageSession()Gets the X4OLanguageSession.- Returns:
- Returns the X4OLanguageSession.
-
doCharacters
Sets the body texts on an event based system.- Parameters:
body- The body text.- Throws:
ElementException- Can be thrown when structure is not correct.
-
doComment
Sets the comment texts on an event based system.- Parameters:
comment- The comment text.- Throws:
ElementException- Can be thrown when structure is not correct.
-
doIgnorableWhitespace
Is called when there is whitespace in xml.- Parameters:
space- The space.- Throws:
ElementException- Can be thrown when structure is not correct.
-
setElementClass
Sets the ElementClass.- Parameters:
elementClass- The ElementClass to set.
-
getElementClass
-
setAttribute
-
getAttributes
-
getChilderen
-
getAllChilderen
-
addChild
Adds an Elment as child of this element.- Parameters:
element- The child to add.
-
removeChild
Removes an Elment as child of this element.- Parameters:
element- The child to remove.
-
getElementType
-
isTransformingTree
boolean isTransformingTree()Returns if this elements transforms the tree. if true the the doElementRun is runned in the transform phase insteat of the run phase. You need to add those new or modified Elements to the DirtyElement for reparsering.- Returns:
- Returns true if transforming tree.
-