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.
Version:
1.0 Feb 01, 2005
Author:
Willem Cazander
  • Method Details

    • doElementEnd

      void doElementEnd() throws ElementException
      This method is fired when the end xml tag is parsed.
      Throws:
      ElementException - Can be thrown when structure is not correct.
    • doElementStart

      void doElementStart() throws ElementException
      This method is fired when the start of xml tag is parsed.
      Throws:
      ElementException - Can be thrown when structure is not correct.
    • doElementRun

      void doElementRun() throws ElementException
      This method is fired only once in the run phase.
      Throws:
      ElementException - Can be thrown when structure is not correct.
    • setParent

      void setParent(Element element)
      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

      void release() throws ElementException
      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

      void setElementObject(Object object)
      Sets the object which we control.
      Parameters:
      object - The object to configed by this element.
    • setLanguageSession

      void setLanguageSession(X4OLanguageSession languageSession)
      Sets the X4OLanguageSession.
      Parameters:
      languageSession - The X4OLanguageSession to set.
    • getLanguageSession

      X4OLanguageSession getLanguageSession()
      Gets the X4OLanguageSession.
      Returns:
      Returns the X4OLanguageSession.
    • doCharacters

      void doCharacters(String body) throws ElementException
      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

      void doComment(String comment) throws ElementException
      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

      void doIgnorableWhitespace(String space) throws ElementException
      Is called when there is whitespace in xml.
      Parameters:
      space - The space.
      Throws:
      ElementException - Can be thrown when structure is not correct.
    • setElementClass

      void setElementClass(ElementClass elementClass)
      Sets the ElementClass.
      Parameters:
      elementClass - The ElementClass to set.
    • getElementClass

      ElementClass getElementClass()
      Gets the ElementClass.
      Returns:
      Returns the ElementClass.
    • setAttribute

      void setAttribute(String name, String value)
      Sets the xml attributes.
      Parameters:
      name - The name to set.
      value - The value to set.
    • getAttributes

      Map<String,String> getAttributes()
      Gets the xml attributes.
      Returns:
      Returns the xml attributes.
    • getChilderen

      List<Element> getChilderen()
      Gets the childeren elements.
      Returns:
      Returns the childeren.
    • getAllChilderen

      List<Element> getAllChilderen()
      Gets the childeren elements including those which are comment and white space. (text)
      Returns:
      Returns all the childeren.
    • addChild

      void addChild(Element element)
      Adds an Elment as child of this element.
      Parameters:
      element - The child to add.
    • removeChild

      void removeChild(Element element)
      Removes an Elment as child of this element.
      Parameters:
      element - The child to remove.
    • getElementType

      Element.ElementType getElementType()
      Gets the Element type.
      Returns:
      Returns the ElementType.
    • 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.