org.mycore.frontend.editor
Class MCREditorDefReader

java.lang.Object
  extended by org.mycore.frontend.editor.MCREditorDefReader

public class MCREditorDefReader
extends Object


Field Summary
(package private)  HashMap<String,Element> id2component
           
(package private)  HashMap<Element,String> referencing2ref
           
 
Constructor Summary
MCREditorDefReader(String uri, String ref, boolean validate)
          Reads the editor definition from the given URI
 
Method Summary
(package private) static Element findElementByID(String id, Element candidate)
          Returns that direct or indirect child element of the given element, thats ID attribute has the given value.
(package private) static void fixConditionedVariables(Element editor)
          Transforms @var attribute values that have a condition like title[@type='main'] into escaped internal syntax title__type__main
(package private)  Element getEditor()
          Returns the complete editor with all references resolved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id2component

HashMap<String,Element> id2component

referencing2ref

HashMap<Element,String> referencing2ref
Constructor Detail

MCREditorDefReader

MCREditorDefReader(String uri,
                   String ref,
                   boolean validate)
Reads the editor definition from the given URI

Parameters:
validate - if true, validate editor definition against schema
Method Detail

getEditor

Element getEditor()
Returns the complete editor with all references resolved


findElementByID

static Element findElementByID(String id,
                               Element candidate)
Returns that direct or indirect child element of the given element, thats ID attribute has the given value.

Parameters:
id - the value the ID attribute must have
candidate - the element to start searching with
Returns:
the element below that has the given ID, or null if no such element exists.

fixConditionedVariables

static void fixConditionedVariables(Element editor)
Transforms @var attribute values that have a condition like title[@type='main'] into escaped internal syntax title__type__main