From 57f3c206552864f5cf7ca6f5c788b147ccdc0f9a Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sat, 24 Aug 2013 22:04:18 +0200 Subject: [PATCH] Moved global attributes to namespace attribute to reflect schema infoset. --- .../org/x4o/xml/eld/EldModuleLoaderCore.java | 6 +- .../eld/lang/ElementModuleBindingHandler.java | 10 - .../lang/ElementNamespaceBindingHandler.java | 12 +- .../xml/eld/lang/NextAttributeElement.java | 6 +- .../org/x4o/xml/eld/xsd/EldXsdXmlWriter.java | 7 +- .../xml/element/AbstractElementNamespace.java | 20 +- ...=> AbstractElementNamespaceAttribute.java} | 14 +- ...tElementNamespaceAttributeComparator.java} | 12 +- .../org/x4o/xml/element/ElementNamespace.java | 12 + ...er.java => ElementNamespaceAttribute.java} | 4 +- .../java/org/x4o/xml/io/DefaultX4OReader.java | 2 +- .../java/org/x4o/xml/io/DefaultX4OWriter.java | 2 +- .../org/x4o/xml/io/sax/X4ODebugWriter.java | 40 +- .../AbstractX4OLanguageConfiguration.java | 14 +- .../xml/lang/AbstractX4OLanguageModule.java | 25 - .../lang/DefaultX4OLanguageConfiguration.java | 4 +- .../xml/lang/X4OLanguageConfiguration.java | 2 +- .../lang/X4OLanguageConfigurationLocal.java | 2 +- .../org/x4o/xml/lang/X4OLanguageModule.java | 15 +- .../xml/lang/phase/X4OPhaseLanguageRead.java | 23 +- .../resources/META-INF/cel/cel-core-1.0.xsd | 412 ++++----- .../resources/META-INF/cel/cel-root-1.0.xsd | 92 +- .../resources/META-INF/eld/eld-conv-1.0.xsd | 311 +++---- .../resources/META-INF/eld/eld-lang-1.0.xsd | 855 ++++++++---------- .../main/resources/META-INF/eld/eld-lang.eld | 16 +- .../resources/META-INF/eld/eld-root-1.0.xsd | 122 +-- ...ava => TestElementNamespaceAttribute.java} | 4 +- .../META-INF/junit-defd/defd-lang.eld | 23 +- .../resources/META-INF/test/test-lang.eld | 23 +- .../test/resources/META-INF/x4o-drivers.xml | 2 +- .../org/x4o/xml/eld/doc/EldDocWriter.java | 8 +- .../x4o/xml/eld/doc/EldDocWriterLanguage.java | 6 +- .../eld/doc/EldDocWriterLanguageModule.java | 6 +- .../xml/lang/meta/ELIDAttributeHandler.java | 4 +- 34 files changed, 958 insertions(+), 1158 deletions(-) rename x4o-driver/src/main/java/org/x4o/xml/element/{AbstractElementAttributeHandler.java => AbstractElementNamespaceAttribute.java} (79%) rename x4o-driver/src/main/java/org/x4o/xml/element/{DefaultGlobalAttributeHandlerComparator.java => DefaultElementNamespaceAttributeComparator.java} (82%) rename x4o-driver/src/main/java/org/x4o/xml/element/{ElementAttributeHandler.java => ElementNamespaceAttribute.java} (95%) rename x4o-driver/src/test/java/org/x4o/xml/test/element/{TestElementAttributeHandler.java => TestElementNamespaceAttribute.java} (91%) diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java b/x4o-driver/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java index 11512e7..1df1bbf 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java +++ b/x4o-driver/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java @@ -150,8 +150,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader { ec.addElementClassAttribute(createElementClassAttribute(language,"bean.class",true,null)); namespace.addElementClass(ec); - ec = createElementClass(language,"attributeHandler",null,BeanElement.class,"Defines generic attribute handler for language."); - ec.addElementParent(CEL_ROOT_URI, "module"); + ec = createElementClass(language,"namespaceAttribute",null,BeanElement.class,"Defines generic namespace attribute for language."); + ec.addElementParent(CEL_CORE_URI, "namespace"); ec.addElementClassAttribute(createElementClassAttribute(language,"bean.class",true,null)); namespace.addElementClass(ec); @@ -172,7 +172,7 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader { ec.setSchemaContentBase("string"); ec.addElementParent(CEL_ROOT_URI, "module"); ec.addElementParent(CEL_CORE_URI, "namespace"); - ec.addElementParent(CEL_CORE_URI, "attributeHandler"); + ec.addElementParent(CEL_CORE_URI, "namespaceAttribute"); ec.addElementParent(CEL_CORE_URI, "bindingHandler"); ec.addElementParent(CEL_CORE_URI, "configurator"); ec.addElementParent(CEL_CORE_URI, "configuratorGlobal"); diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java index 61f1d7f..265c5c1 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java +++ b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java @@ -25,7 +25,6 @@ package org.x4o.xml.eld.lang; import org.x4o.xml.eld.EldModuleLoader; import org.x4o.xml.element.AbstractElementBindingHandler; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementAttributeHandler; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementBindingHandlerException; import org.x4o.xml.element.ElementConfiguratorGlobal; @@ -51,7 +50,6 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler< ElementInterface.class, ElementNamespace.class, ElementBindingHandler.class, - ElementAttributeHandler.class, ElementConfiguratorGlobal.class, }; @@ -151,11 +149,6 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler< languageModule.addElementBindingHandler(elementBindingHandler); return; } - if (childObject instanceof ElementAttributeHandler) { - ElementAttributeHandler elementAttributeHandler = (ElementAttributeHandler)childObject; - languageModule.addElementAttributeHandler(elementAttributeHandler); - return; - } if (childObject instanceof ElementConfiguratorGlobal) { ElementConfiguratorGlobal elementConfigurator = (ElementConfiguratorGlobal)childObject; languageModule.addElementConfiguratorGlobal(elementConfigurator); @@ -176,9 +169,6 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler< for (ElementBindingHandler child:parent.getElementBindingHandlers()) { createChild(parentElement, child); } - for (ElementAttributeHandler child:parent.getElementAttributeHandlers()) { - createChild(parentElement, child); - } for (ElementConfiguratorGlobal child:parent.getElementConfiguratorGlobals()) { createChild(parentElement, child); } diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementNamespaceBindingHandler.java b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementNamespaceBindingHandler.java index 7015c31..79e9c50 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementNamespaceBindingHandler.java +++ b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementNamespaceBindingHandler.java @@ -27,6 +27,7 @@ import org.x4o.xml.element.Element; import org.x4o.xml.element.ElementBindingHandlerException; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementNamespace; +import org.x4o.xml.element.ElementNamespaceAttribute; /** * ElementNamespaceBindingHandler binds ElementClass into namespace. @@ -37,7 +38,8 @@ import org.x4o.xml.element.ElementNamespace; public class ElementNamespaceBindingHandler extends AbstractElementBindingHandler { private final static Class[] CLASSES_CHILD = new Class[] { - ElementClass.class + ElementClass.class, + ElementNamespaceAttribute.class }; /** @@ -65,6 +67,11 @@ public class ElementNamespaceBindingHandler extends AbstractElementBindingHandle } parent.addElementClass(elementClass); } + if (childObject instanceof ElementNamespaceAttribute) { + ElementNamespaceAttribute elementNamespaceAttribute = (ElementNamespaceAttribute)childObject; + parent.addElementNamespaceAttribute(elementNamespaceAttribute); + return; + } } /** @@ -74,5 +81,8 @@ public class ElementNamespaceBindingHandler extends AbstractElementBindingHandle for (ElementClass child:parent.getElementClasses()) { createChild(parentElement, child); } + for (ElementNamespaceAttribute child:parent.getElementNamespaceAttributes()) { + createChild(parentElement, child); + } } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/NextAttributeElement.java b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/NextAttributeElement.java index 4b7d564..97a5707 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/NextAttributeElement.java +++ b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/NextAttributeElement.java @@ -23,7 +23,7 @@ package org.x4o.xml.eld.lang; import org.x4o.xml.element.AbstractElement; -import org.x4o.xml.element.ElementAttributeHandler; +import org.x4o.xml.element.ElementNamespaceAttribute; import org.x4o.xml.element.ElementException; /** @@ -44,8 +44,8 @@ public class NextAttributeElement extends AbstractElement { if (getParent()==null) { throw new ElementException("can't be a root tag"); } - if (getParent().getElementObject() instanceof ElementAttributeHandler) { - ((ElementAttributeHandler)getParent().getElementObject()).addNextAttribute(param); + if (getParent().getElementObject() instanceof ElementNamespaceAttribute) { + ((ElementNamespaceAttribute)getParent().getElementObject()).addNextAttribute(param); } else { throw new ElementException("Wrong parent class"); } diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java b/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java index 0fb73cf..e92bf3b 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java +++ b/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.x4o.xml.element.ElementAttributeHandler; +import org.x4o.xml.element.ElementNamespaceAttribute; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; @@ -288,9 +288,9 @@ public class EldXsdXmlWriter { writeElementAttribute(null,atts); } } - + /* TODO: fix xsd namespace attribute printing !!! for (X4OLanguageModule mod:language.getLanguageModules()) { - for (ElementAttributeHandler eah:mod.getElementAttributeHandlers()) { + for (ElementNamespaceAttribute eah:ns.getElementNamespaceAttributes()) { attrNames.add(eah.getAttributeName()); atts = new AttributesImpl(); atts.addAttribute ("", "name", "", "", eah.getAttributeName()); @@ -298,6 +298,7 @@ public class EldXsdXmlWriter { writeElementAttribute(eah,atts); } } + */ if (ec.getAutoAttributes()!=null && ec.getAutoAttributes()==false) { // oke, reverse this if and rm whitespace. diff --git a/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespace.java b/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespace.java index ed91320..1bf7289 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespace.java +++ b/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespace.java @@ -44,9 +44,11 @@ public abstract class AbstractElementNamespace extends AbstractElementMetaBase i private String schemaResource = null; private String schemaPrefix = null; private Boolean languageRoot = null; + private List elementNamespaceAttributes = null; public AbstractElementNamespace() { - elementClasses = new HashMap(100); + elementClasses = new HashMap(60); + elementNamespaceAttributes = new ArrayList(5); } /** @@ -184,4 +186,20 @@ public abstract class AbstractElementNamespace extends AbstractElementMetaBase i public void setSchemaPrefix(String schemaPrefix) { this.schemaPrefix = schemaPrefix; } + + + public void addElementNamespaceAttribute(ElementNamespaceAttribute elementNamespaceAttribute) { + if (elementNamespaceAttribute==null) { + throw new NullPointerException("Can't add null object"); + } + if (elementNamespaceAttribute.getId()==null) { + throw new NullPointerException("Can't add with null id property."); + } + //logger.finer("Adding elementNamespaceAttribute: "+elementNamespaceAttribute.getAttributeName()); + elementNamespaceAttributes.add(elementNamespaceAttribute); + } + + public List getElementNamespaceAttributes() { + return elementNamespaceAttributes; + } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementAttributeHandler.java b/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespaceAttribute.java similarity index 79% rename from x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementAttributeHandler.java rename to x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespaceAttribute.java index d27bc95..3123ae4 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementAttributeHandler.java +++ b/x4o-driver/src/main/java/org/x4o/xml/element/AbstractElementNamespaceAttribute.java @@ -26,18 +26,18 @@ import java.util.ArrayList; import java.util.List; /** - * An AbstractElementAttributeHandler. + * An AbstractElementNamespaceAttribute. * * @author Willem Cazander * @version 1.0 Aug 10, 2006 */ -public abstract class AbstractElementAttributeHandler extends AbstractElementConfigurator implements ElementAttributeHandler { +public abstract class AbstractElementNamespaceAttribute extends AbstractElementConfigurator implements ElementNamespaceAttribute { private String attributeName = null; private List nextAttributes = new ArrayList(2); /** - * @see org.x4o.xml.element.ElementAttributeHandler#addNextAttribute(java.lang.String) + * @see org.x4o.xml.element.ElementNamespaceAttribute#addNextAttribute(java.lang.String) */ public void addNextAttribute(String attribute) { if (attribute==null) { @@ -47,7 +47,7 @@ public abstract class AbstractElementAttributeHandler extends AbstractElementCon } /** - * @see org.x4o.xml.element.ElementAttributeHandler#removeNextAttribute(java.lang.String) + * @see org.x4o.xml.element.ElementNamespaceAttribute#removeNextAttribute(java.lang.String) */ public void removeNextAttribute(String attribute) { if (attribute==null) { @@ -57,21 +57,21 @@ public abstract class AbstractElementAttributeHandler extends AbstractElementCon } /** - * @see org.x4o.xml.element.ElementAttributeHandler#getNextAttributes() + * @see org.x4o.xml.element.ElementNamespaceAttribute#getNextAttributes() */ public List getNextAttributes() { return nextAttributes; } /** - * @see org.x4o.xml.element.ElementAttributeHandler#getAttributeName() + * @see org.x4o.xml.element.ElementNamespaceAttribute#getAttributeName() */ public String getAttributeName() { return attributeName; } /** - * @see org.x4o.xml.element.ElementAttributeHandler#setAttributeName(java.lang.String) + * @see org.x4o.xml.element.ElementNamespaceAttribute#setAttributeName(java.lang.String) */ public void setAttributeName(String attributeName) { this.attributeName=attributeName; diff --git a/x4o-driver/src/main/java/org/x4o/xml/element/DefaultGlobalAttributeHandlerComparator.java b/x4o-driver/src/main/java/org/x4o/xml/element/DefaultElementNamespaceAttributeComparator.java similarity index 82% rename from x4o-driver/src/main/java/org/x4o/xml/element/DefaultGlobalAttributeHandlerComparator.java rename to x4o-driver/src/main/java/org/x4o/xml/element/DefaultElementNamespaceAttributeComparator.java index 99ff5f5..9a5bd12 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/element/DefaultGlobalAttributeHandlerComparator.java +++ b/x4o-driver/src/main/java/org/x4o/xml/element/DefaultElementNamespaceAttributeComparator.java @@ -27,21 +27,21 @@ import java.util.Comparator; /** - * The DefaultGlobalAttributeHandlerComparator.
- * This Comparator compares the NextAttribute names with the attributeName of the ElementAttributeHandlers.
+ * The DefaultElementNamespaceAttributeComparator.
+ * This Comparator compares the NextAttribute names with the attributeName of the ElementNamespaceAttribute.
* * @author Willem Cazander * @version 1.0 Feb 14, 2007 */ -public class DefaultGlobalAttributeHandlerComparator implements Comparator { +public class DefaultElementNamespaceAttributeComparator implements Comparator { /** - * @param e1 The first ElementAttributeHandler to compare. - * @param e2 The second ElementAttributeHandler to compare. + * @param e1 The first ElementNamespaceAttribute to compare. + * @param e2 The second ElementNamespaceAttribute to compare. * @return 0 is same. * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ - public int compare(ElementAttributeHandler e1, ElementAttributeHandler e2) { + public int compare(ElementNamespaceAttribute e1, ElementNamespaceAttribute e2) { for (String param:e1.getNextAttributes()) { if(param.equals(e2.getAttributeName())) { diff --git a/x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespace.java b/x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespace.java index cef03a1..8b460d2 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespace.java +++ b/x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespace.java @@ -144,4 +144,16 @@ public interface ElementNamespace extends ElementMetaBase { * @param schemaPrefix the schemaPrefix to set */ void setSchemaPrefix(String schemaPrefix); + + /** + * Adds an ElementNamespaceAttribute. + * @param elementNamespaceAttribute Adds an ElementNamespaceAttribute. + */ + void addElementNamespaceAttribute(ElementNamespaceAttribute elementNamespaceAttribute); + + /** + * Geta All ElementNamespaceAttributes. + * @return Returns an List of ElementNamespaceAttributes. + */ + List getElementNamespaceAttributes(); } diff --git a/x4o-driver/src/main/java/org/x4o/xml/element/ElementAttributeHandler.java b/x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespaceAttribute.java similarity index 95% rename from x4o-driver/src/main/java/org/x4o/xml/element/ElementAttributeHandler.java rename to x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespaceAttribute.java index bbb5d1d..6743ddc 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/element/ElementAttributeHandler.java +++ b/x4o-driver/src/main/java/org/x4o/xml/element/ElementNamespaceAttribute.java @@ -30,7 +30,7 @@ import java.util.List; * @author Willem Cazander * @version 1.0 Aug 20, 2005 */ -public interface ElementAttributeHandler extends ElementConfigurator { +public interface ElementNamespaceAttribute extends ElementConfigurator { /** * Gets the attribute name this attribute handler handles. @@ -46,7 +46,7 @@ public interface ElementAttributeHandler extends ElementConfigurator { /** * Adds an NextAttribute. - * There next attributes will defines the order in which the ElementAttributeHandlers are executed. + * There next attributes will defines the order in which the ElementNamespaceAttribute are executed. * @param attribute Add attribute which be will processed after this one. */ void addNextAttribute(String attribute); diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java index e5ed46d..03757d9 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java @@ -64,7 +64,7 @@ public class DefaultX4OReader extends AbstractX4OReader { private X4OLanguageSession languageSession = null; - private PropertyConfig propertyConfig; + private final PropertyConfig propertyConfig; private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_READER; private final static String PROPERTY_SAX_ERROR_HANDLER = "sax/error-handler"; diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java index ed5c3c3..6b3783a 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java @@ -59,7 +59,7 @@ import org.xml.sax.helpers.AttributesImpl; */ public class DefaultX4OWriter extends AbstractX4OWriter { - private PropertyConfig propertyConfig; + private final PropertyConfig propertyConfig; private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_WRITER; private final static String PROPERTY_OUTPUT_STREAM = "output/stream"; diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java b/x4o-driver/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java index c69f3fb..048ff9a 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java @@ -29,7 +29,7 @@ import java.util.Map; import org.x4o.xml.conv.ObjectConverter; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementAttributeHandler; +import org.x4o.xml.element.ElementNamespaceAttribute; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; @@ -154,7 +154,7 @@ public class X4ODebugWriter { debugLanguageDefaultClass("getDefaultElementNamespaceInstanceProvider",conf.getDefaultElementNamespaceInstanceProvider()); debugLanguageDefaultClass("getDefaultElementAttributeValueParser",conf.getDefaultElementAttributeValueParser()); debugLanguageDefaultClass("getDefaultElementObjectPropertyValue",conf.getDefaultElementObjectPropertyValue()); - debugLanguageDefaultClass("getDefaultElementAttributeHandlerComparator",conf.getDefaultElementAttributeHandlerComparator()); + debugLanguageDefaultClass("getDefaultElementNamespaceAttributeComparator",conf.getDefaultElementNamespaceAttributeComparator()); contentWriter.endElement(DEBUG_URI, "X4OLanguageDefaultClasses", ""); } catch (SAXException e) { @@ -230,30 +230,9 @@ public class X4ODebugWriter { } contentWriter.startElement (DEBUG_URI, "ElementLanguageModule", "", atts); - //module.getElementAttributeHandlers(); - //module.getElementBindingHandlers(); - //module.getGlobalElementConfigurators(); - //module.getElementInterfaces(); - //module.getElementNamespace(); - debugElementConfiguratorGlobal(module.getElementConfiguratorGlobals()); debugElementBindingHandler(module.getElementBindingHandlers()); - for (ElementAttributeHandler p:module.getElementAttributeHandlers()) { - atts = new AttributesImpl(); - atts.addAttribute ("", "attributeName", "", "", p.getAttributeName()); - atts.addAttribute ("", "description", "", "", p.getDescription()); - atts.addAttribute ("", "className", "", "", p.getClass().getName()); - contentWriter.startElement (DEBUG_URI, "elementAttributeHandler", "", atts); - for (String para:p.getNextAttributes()) { - atts = new AttributesImpl(); - atts.addAttribute ("", "attributeName", "", "", para); - contentWriter.startElement (DEBUG_URI, "nextAttribute", "", atts); - contentWriter.endElement(DEBUG_URI, "nextAttribute", ""); - } - contentWriter.endElement(DEBUG_URI, "elementAttributeHandler", ""); - } - for (ElementInterface elementInterface:module.getElementInterfaces()) { atts = new AttributesImpl(); atts.addAttribute ("", "className", "", "", elementInterface.getClass().getName()); @@ -274,6 +253,21 @@ public class X4ODebugWriter { atts.addAttribute ("", "className", "", "", enc.getClass().getName()); contentWriter.startElement (DEBUG_URI, ElementNamespace.class.getSimpleName(), "", atts); + + for (ElementNamespaceAttribute p:enc.getElementNamespaceAttributes()) { + atts = new AttributesImpl(); + atts.addAttribute ("", "attributeName", "", "", p.getAttributeName()); + atts.addAttribute ("", "description", "", "", p.getDescription()); + atts.addAttribute ("", "className", "", "", p.getClass().getName()); + contentWriter.startElement (DEBUG_URI, "elementNamespaceAttribute", "", atts); + for (String para:p.getNextAttributes()) { + atts = new AttributesImpl(); + atts.addAttribute ("", "attributeName", "", "", para); + contentWriter.startElement (DEBUG_URI, "nextAttribute", "", atts); + contentWriter.endElement(DEBUG_URI, "nextAttribute", ""); + } + contentWriter.endElement(DEBUG_URI, "elementNamespaceAttribute", ""); + } for (ElementClass ec:enc.getElementClasses()) { debugElementClass(ec); } diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageConfiguration.java b/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageConfiguration.java index a6f3ae3..3e96855 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageConfiguration.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageConfiguration.java @@ -46,7 +46,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon private Class defaultElementNamespaceInstanceProvider = null; private Class defaultElementAttributeValueParser = null; private Class defaultElementObjectPropertyValue = null; - private Class defaultElementAttributeHandlerComparator = null; + private Class defaultElementNamespaceAttributeComparator = null; private Class defaultLanguageVersionFilter = null; private Class defaultLanguageLoader = null; @@ -255,17 +255,17 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon } /** - * @return the defaultElementAttributeHandlerComparator + * @return the defaultElementNamespaceAttributeComparator */ - public Class getDefaultElementAttributeHandlerComparator() { - return defaultElementAttributeHandlerComparator; + public Class getDefaultElementNamespaceAttributeComparator() { + return defaultElementNamespaceAttributeComparator; } /** - * @param defaultElementAttributeHandlerComparator the defaultElementAttributeHandlerComparator to set + * @param defaultElementNamespaceAttributeComparator the defaultElementNamespaceAttributeComparator to set */ - public void setDefaultElementAttributeHandlerComparator(Class defaultElementAttributeHandlerComparator) { - this.defaultElementAttributeHandlerComparator = defaultElementAttributeHandlerComparator; + public void setDefaultElementNamespaceAttributeComparator(Class defaultElementNamespaceAttributeComparator) { + this.defaultElementNamespaceAttributeComparator = defaultElementNamespaceAttributeComparator; } /** diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java b/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java index 7056ddc..12d66d1 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java @@ -29,7 +29,6 @@ import java.util.ArrayList; import java.util.logging.Logger; import org.x4o.xml.element.AbstractElementMetaBase; -import org.x4o.xml.element.ElementAttributeHandler; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementConfiguratorGlobal; import org.x4o.xml.element.ElementInterface; @@ -48,7 +47,6 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase private String providerHost=null; private String sourceResource = null; - private List elementAttributeHandlers = null; private List elementBindingHandlers = null; private List elementConfiguratorGlobals = null; private List elementInterfaces = null; @@ -61,7 +59,6 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase public AbstractX4OLanguageModule() { logger = Logger.getLogger(AbstractX4OLanguageSession.class.getName()); logger.finest("Creating new ParsingContext"); - elementAttributeHandlers = new ArrayList(4); elementBindingHandlers = new ArrayList(4); elementConfiguratorGlobals = new ArrayList(4); elementInterfaces = new ArrayList(20); @@ -95,27 +92,6 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase public void setProviderHost(String providerHost) { this.providerHost = providerHost; } - - /** - * @see org.x4o.xml.lang.X4OLanguageModule#addElementAttributeHandler(ElementAttributeHandler) - */ - public void addElementAttributeHandler(ElementAttributeHandler elementAttributeHandler) { - if (elementAttributeHandler==null) { - throw new NullPointerException("Can't add null object"); - } - if (elementAttributeHandler.getId()==null) { - throw new NullPointerException("Can't add with null id property."); - } - logger.finer("Adding ElementAttributeHandler: "+elementAttributeHandler.getAttributeName()); - elementAttributeHandlers.add(elementAttributeHandler); - } - - /** - * @see org.x4o.xml.lang.X4OLanguageModule#getElementAttributeHandlers() - */ - public List getElementAttributeHandlers() { - return elementAttributeHandlers; - } /** * @see org.x4o.xml.lang.X4OLanguageModule#addElementBindingHandler(ElementBindingHandler) @@ -249,7 +225,6 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase * Reloads the module, experiment !! */ public void reloadModule(X4OLanguageLocal elementLanguage,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException { - elementAttributeHandlers.clear(); elementBindingHandlers.clear(); elementInterfaces.clear(); elementNamespaces.clear(); diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageConfiguration.java b/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageConfiguration.java index 5ac516f..3e2350b 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageConfiguration.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageConfiguration.java @@ -38,7 +38,7 @@ import org.x4o.xml.element.DefaultElementInterface; import org.x4o.xml.element.DefaultElementNamespace; import org.x4o.xml.element.DefaultElementNamespaceInstanceProvider; import org.x4o.xml.element.DefaultElementObjectPropertyValue; -import org.x4o.xml.element.DefaultGlobalAttributeHandlerComparator; +import org.x4o.xml.element.DefaultElementNamespaceAttributeComparator; /** * Provides all implementions of the different parts of the language parser. @@ -69,7 +69,7 @@ public class DefaultX4OLanguageConfiguration extends AbstractX4OLanguageConfigur if (getDefaultElementNamespaceInstanceProvider()==null) { setDefaultElementNamespaceInstanceProvider( DefaultElementNamespaceInstanceProvider.class); } if (getDefaultElementAttributeValueParser()==null) { setDefaultElementAttributeValueParser( DefaultElementAttributeValueParser.class); } if (getDefaultElementObjectPropertyValue()==null) { setDefaultElementObjectPropertyValue( DefaultElementObjectPropertyValue.class); } - if (getDefaultElementAttributeHandlerComparator()==null) { setDefaultElementAttributeHandlerComparator( DefaultGlobalAttributeHandlerComparator.class); } + if (getDefaultElementNamespaceAttributeComparator()==null){ setDefaultElementNamespaceAttributeComparator( DefaultElementNamespaceAttributeComparator.class); } if (getDefaultLanguageVersionFilter()==null) { setDefaultLanguageVersionFilter( DefaultX4OLanguageVersionFilter.class); } if (getDefaultLanguageLoader()==null) { setDefaultLanguageLoader( DefaultX4OLanguageLoader.class); } if (getDefaultExpressionLanguageContext()==null) { setDefaultExpressionLanguageContext( X4OELContext.class); } diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java b/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java index 9c81aa6..76dd2f8 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java @@ -61,7 +61,7 @@ public interface X4OLanguageConfiguration { Class getDefaultElementNamespaceInstanceProvider(); Class getDefaultElementAttributeValueParser(); Class getDefaultElementObjectPropertyValue(); - Class getDefaultElementAttributeHandlerComparator(); + Class getDefaultElementNamespaceAttributeComparator(); /** * @return Returns the X4OLanguageVersionFilter which filters the best version to use. diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfigurationLocal.java b/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfigurationLocal.java index af113e1..05b6484 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfigurationLocal.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageConfigurationLocal.java @@ -48,7 +48,7 @@ public interface X4OLanguageConfigurationLocal extends X4OLanguageConfiguration void setDefaultElementNamespaceInstanceProvider(Class value); void setDefaultElementAttributeValueParser(Class value); void setDefaultElementObjectPropertyValue(Class value); - void setDefaultElementAttributeHandlerComparator(Class value); + void setDefaultElementNamespaceAttributeComparator(Class value); void setDefaultLanguageVersionFilter(Class value); void setDefaultLanguageLoader(Class value); diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java b/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java index 149a042..d618bfb 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java @@ -24,7 +24,6 @@ package org.x4o.xml.lang; import java.util.List; -import org.x4o.xml.element.ElementAttributeHandler; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementConfiguratorGlobal; import org.x4o.xml.element.ElementInterface; @@ -60,24 +59,12 @@ public interface X4OLanguageModule extends ElementMetaBase { */ void setProviderHost(String providerHost); - /** - * Adds an ElementAttributeHandler. - * @param elementAttributeHandler Adds an ElmentAttributeHandler. - */ - void addElementAttributeHandler(ElementAttributeHandler elementAttributeHandler); - - /** - * Geta All ElementAttributeHandlers. - * @return Returns an List of ElementAttributeHandlers. - */ - List getElementAttributeHandlers(); - /** * Adds an ElementBindingHanlder. * @param elementBindingHandler The ElementBindingHandler to add. */ void addElementBindingHandler(ElementBindingHandler elementBindingHandler); - + /** * Gets all ElementBindingHandlers. * @return Returns an List with all ElementBindingHandlers. diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java index a808352..0605a8a 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java @@ -31,7 +31,7 @@ import java.util.logging.Logger; import org.x4o.xml.conv.ObjectConverterException; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementAttributeHandler; +import org.x4o.xml.element.ElementNamespaceAttribute; import org.x4o.xml.element.ElementAttributeValueParser; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; @@ -263,7 +263,7 @@ public class X4OPhaseLanguageRead { * X4OPhaseReadConfigGlobalAttribute */ class X4OPhaseReadConfigGlobalAttribute extends AbstractX4OPhase { - Comparator elementAttributeHandlerComparator = null; + Comparator elementNamespaceAttributeComparator = null; private X4OPhaseReadRunConfigurator runConf = null; public X4OPhaseReadConfigGlobalAttribute(X4OPhaseReadRunConfigurator runConf) { this.runConf=runConf; @@ -279,9 +279,9 @@ public class X4OPhaseLanguageRead { } @SuppressWarnings("unchecked") public void runElementPhase(Element element) throws X4OPhaseException { - if (elementAttributeHandlerComparator==null) { + if (elementNamespaceAttributeComparator==null) { try { - elementAttributeHandlerComparator = (Comparator)X4OLanguageClassLoader.newInstance(element.getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementAttributeHandlerComparator()); + elementNamespaceAttributeComparator = (Comparator)X4OLanguageClassLoader.newInstance(element.getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementNamespaceAttributeComparator()); } catch (Exception e) { throw new X4OPhaseException(this,e); } @@ -289,17 +289,18 @@ public class X4OPhaseLanguageRead { // do global parameters logger.finest("Do Element Global AttributeHandlers."); - List handlers = new ArrayList(); + List handlers = new ArrayList(); for (X4OLanguageModule mod:element.getLanguageSession().getLanguage().getLanguageModules()) { - for (ElementAttributeHandler global:mod.getElementAttributeHandlers()) { - - String attribute = element.getAttributes().get(global.getAttributeName()); - if (attribute!=null) { - handlers.add(global); + for (ElementNamespace ns:mod.getElementNamespaces()) { + for (ElementNamespaceAttribute global:ns.getElementNamespaceAttributes()) { + String attribute = element.getAttributes().get(global.getAttributeName()); + if (attribute!=null) { + handlers.add(global); + } } } } - Collections.sort(handlers,elementAttributeHandlerComparator); + Collections.sort(handlers,elementNamespaceAttributeComparator); List handlers2 = new ArrayList(handlers.size()); handlers2.addAll(handlers); for (ElementConfigurator ec:handlers) { diff --git a/x4o-driver/src/main/resources/META-INF/cel/cel-core-1.0.xsd b/x4o-driver/src/main/resources/META-INF/cel/cel-core-1.0.xsd index ef4aeda..ac79fc4 100644 --- a/x4o-driver/src/main/resources/META-INF/cel/cel-core-1.0.xsd +++ b/x4o-driver/src/main/resources/META-INF/cel/cel-core-1.0.xsd @@ -1,225 +1,193 @@ - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Defines an xml namespace. - - - - - - Adds description as text on all eld elements. - - - - - - Defines xml element tag. - - - - - - Define generic global configuator for languge. - - - - - - Adds an attribute alias. - - - - - - Define generic configurator for language. - - - - - - Defines generic attribute handler for language. - - - - - - Defines xml element attribute. - - - - - - Converts string attribute to java class instance. - - - - - - Defines generic binding handler for languge. - - - - - - Defines element interface class. - - - - - - Added (meta) element parent. - - - - + Uri: http://cel.x4o.org/xml/ns/cel-core + Uri schema: http://cel.x4o.org/xml/ns/cel-core-1.0.xsd + Created on: Sat Aug 24 22:02:08 CEST 2013 + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defines xml element attribute. + + + + + Converts string attribute to java class instance. + + + + + Defines generic namespace attribute for language. + + + + + Defines an xml namespace. + + + + + Adds description as text on all eld elements. + + + + + Defines generic binding handler for languge. + + + + + Defines xml element tag. + + + + + Define generic global configuator for languge. + + + + + Adds an attribute alias. + + + + + Define generic configurator for language. + + + + + Defines element interface class. + + + + + Added (meta) element parent. + + + diff --git a/x4o-driver/src/main/resources/META-INF/cel/cel-root-1.0.xsd b/x4o-driver/src/main/resources/META-INF/cel/cel-root-1.0.xsd index 121351b..f8e19b5 100644 --- a/x4o-driver/src/main/resources/META-INF/cel/cel-root-1.0.xsd +++ b/x4o-driver/src/main/resources/META-INF/cel/cel-root-1.0.xsd @@ -1,59 +1,39 @@ - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - + Uri: http://cel.x4o.org/xml/ns/cel-root + Uri schema: http://cel.x4o.org/xml/ns/cel-root-1.0.xsd + Created on: Sat Aug 24 22:02:08 CEST 2013 + --> + + + + + + + + + + + + + + + + + + + + diff --git a/x4o-driver/src/main/resources/META-INF/eld/eld-conv-1.0.xsd b/x4o-driver/src/main/resources/META-INF/eld/eld-conv-1.0.xsd index 7c91a32..28bc834 100644 --- a/x4o-driver/src/main/resources/META-INF/eld/eld-conv-1.0.xsd +++ b/x4o-driver/src/main/resources/META-INF/eld/eld-conv-1.0.xsd @@ -1,177 +1,146 @@ - - - - - - + + + + + + - - - - - - - - - - - - - - - - The class name of the converter to load. - - - - - - - - - - - - - - - - - - - - - - The convert 'to' method step. - - - - - - The convert 'from' order. - - - - - - The convert 'from' method step. - - - - - - The convert 'to' order. - - - - - - - - - - - - - - - - - - - - - Set to true to convert to native data type. - - - - - - Shortcut to use only this method for the 'to' convert. - - - - - - The split value expected size. - - - - - - The split regex. - - - - - - The class name to convert the string to. - - - - - - - - - - - - - - - - - - - - - - - Define an loadable in bean.class for an ObjectConverter. - - - - - - - - - - - - - + Created on: Sat Aug 24 21:57:18 CEST 2013 + --> + + + + + + + + + + + + + + + + + + + + + Set to true to convert to native data type. + + + + + Shortcut to use only this method for the 'to' convert. + + + + + The split value expected size. + + + + + The split regex. + + + + + The class name to convert the string to. + + + + + + + + + + + + + + + + + The class name of the converter to load. + + + + + + + + + + + + + + + + + + + + + The convert 'to' method step. + + + + + The convert 'from' order. + + + + + The convert 'from' method step. + + + + + The convert 'to' order. + + + + + + + + + + + + + + + + + + + + + + + + + Define an loadable in bean.class for an ObjectConverter. + + + + + + + diff --git a/x4o-driver/src/main/resources/META-INF/eld/eld-lang-1.0.xsd b/x4o-driver/src/main/resources/META-INF/eld/eld-lang-1.0.xsd index 1e362cd..4d6cecd 100644 --- a/x4o-driver/src/main/resources/META-INF/eld/eld-lang-1.0.xsd +++ b/x4o-driver/src/main/resources/META-INF/eld/eld-lang-1.0.xsd @@ -1,468 +1,399 @@ - - - - - - + + + + + + - - - - - - - - - - The namespace id. - - - - - - - - - - - - - - - - - - - - - - - - - The name of the phase to skip. - - - - - - - - - - - - - - - - - - The attribute id. (with tag as alias) - - - - - - - The class of the wrapped object. - - - - - - An custom element class to config object. - - - - - - - - - - - - - - The alias name to add to the attribute. - - - - - - - - - - - - The global element configurator id. - - - - - - The class of the element configurator. - - - - - - If set to true then run in config phase. - - - - - - - - - - - - The element configurator id. - - - - - - The class of the global element configurator. - - - - - - If set to true then run in config phase. - - - - - - - - - - - - See org.x4o.xml.element.Element.ElementType for options defaults to 'characters'. - - - - - - The id for this configurator. - - - - - - The attribute name to fill the value. - - - - - - - - - - - - The xml attribute name. - - - - - - The atttribute handler id. - - - - - - The class of the attribute handler. - - - - - - - - - - The attribute name to run after this attribute. - - - - - - - - - - - - - - - - - - - - - - - - - - The attribute id. (with name as alias) - - - - - - - - - - - - - - - - - - - - The binding handler id. - - - - - - The class of the binding handler. - - - - - - - - - - - - The class name of the the class to load. - - - - - - - - - - - - The id for this binding handler. - - - - - - The child class. - - - - - - The parent class. - - - - - - The method name of the method used to get the childeren of the parent. - - - - - - The method name of the method used to add the child to the parent. - - - - - - - - - - - - - - - - - - The interface id. - - - - - - The interface class. - - - - - - - - - - The parent tag to have object for. - - - - - - The element namespace uri if non local parent. - - - - - - - - Defines an namespace for the language. - - - - - - An ELD elementDescription field which lets you type text like this one in xml characters instead of an attribute. - - - - - - Adds an phase to skip to the parent element. - - - - - - The xml element. - - - - - - Defines an alias for an attribute name. - - - - - - Define an className in bean.class for an ElementConfiguratorGlobal. - - - - - - Define an className in bean.class for an ElementConfigurator. - - - - - - Defines an alias for an attribute name. - - - - - - Define an className in bean.class for an ElementAttributeHandler. - - - - - - Defines the parameter order. - - - - - - XML Element Attribute tag. - - - - - - Define an className in bean.class for an ElementBindingHandler interface. - - - - - - Loads bean into the Element - - - - - - Lets you dynamicly bind to object togecher. - - - - - - Config element objects by java interface. - - - - - - Adds an parent element tag for xsd - - - - + Created on: Sat Aug 24 21:57:18 CEST 2013 + --> + + + + + + + + + + + + + + + + + + + + + + + The attribute id. (with name as alias) + + + + + + + + + + + + + + + + + + + + The xml attribute name. + + + + + The namespace attribute id. + + + + + The class of the namespace attribute. + + + + + + + + + + + + + The namespace id. + + + + + + + + + + + + + + + + + + + + + + + + + + The binding handler id. + + + + + The class of the binding handler. + + + + + + + + + The name of the phase to skip. + + + + + + + + + + + + + + + + + The attribute id. (with tag as alias) + + + + + + The class of the wrapped object. + + + + + An custom element class to config object. + + + + + + + + + + + + + The alias name to add to the attribute. + + + + + + + + + + + The global element configurator id. + + + + + The class of the element configurator. + + + + + If set to true then run in config phase. + + + + + + + + + + + The element configurator id. + + + + + The class of the global element configurator. + + + + + If set to true then run in config phase. + + + + + + + + + + + The class name of the the class to load. + + + + + + + + + + + The id for this binding handler. + + + + + The child class. + + + + + The parent class. + + + + + The method name of the method used to get the childeren of the parent. + + + + + The method name of the method used to add the child to the parent. + + + + + + + + + + + + + + + The interface id. + + + + + The interface class. + + + + + + + + + + + See org.x4o.xml.element.Element.ElementType for options defaults to 'characters'. + + + + + The id for this configurator. + + + + + The attribute name to fill the value. + + + + + + + + The parent tag to have object for. + + + + + The element namespace uri if non local parent. + + + + + + + + + The attribute name to run after this attribute. + + + + + + + XML Element Attribute tag. + + + + + Define an className in bean.class for an ElementNamespaceAttribute. + + + + + Defines an namespace for the language. + + + + + An ELD elementDescription field which lets you type text like this one in xml characters instead of an attribute. + + + + + Define an className in bean.class for an ElementBindingHandler interface. + + + + + Adds an phase to skip to the parent element. + + + + + The xml element. + + + + + Defines an alias for an attribute name. + + + + + Define an className in bean.class for an ElementConfiguratorGlobal. + + + + + Define an className in bean.class for an ElementConfigurator. + + + + + Loads bean into the Element + + + + + Lets you dynamicly bind to object togecher. + + + + + Config element objects by java interface. + + + + + Defines an alias for an attribute name. + + + + + Adds an parent element tag for xsd + + + + + Defines the parameter order. + + + diff --git a/x4o-driver/src/main/resources/META-INF/eld/eld-lang.eld b/x4o-driver/src/main/resources/META-INF/eld/eld-lang.eld index 067ce5c..4c4373d 100644 --- a/x4o-driver/src/main/resources/META-INF/eld/eld-lang.eld +++ b/x4o-driver/src/main/resources/META-INF/eld/eld-lang.eld @@ -129,18 +129,18 @@ - - Define an className in bean.class for an ElementAttributeHandler. + + Define an className in bean.class for an ElementNamespaceAttribute. - The atttribute handler id. + The namespace attribute id. - The class of the attribute handler. + The class of the namespace attribute. The xml attribute name. - + @@ -176,8 +176,8 @@ An ELD elementDescription field which lets you type text like this one in xml characters instead of an attribute. + - @@ -210,12 +210,12 @@ - + Defines the parameter order. The attribute name to run after this attribute. - + diff --git a/x4o-driver/src/main/resources/META-INF/eld/eld-root-1.0.xsd b/x4o-driver/src/main/resources/META-INF/eld/eld-root-1.0.xsd index 771b6df..d638103 100644 --- a/x4o-driver/src/main/resources/META-INF/eld/eld-root-1.0.xsd +++ b/x4o-driver/src/main/resources/META-INF/eld/eld-root-1.0.xsd @@ -1,79 +1,55 @@ - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - The module id. - - - - - - The provider name in normal en:lang. - - - - - - The provider host like langx.someorg.domain for uri/etc defaults. - - - - - - - - - + Created on: Sat Aug 24 21:57:18 CEST 2013 + --> + + + + + + + + + + + + + + + + + The module id. + + + + + The provider name in normal en:lang. + + + + + The provider host like langx.someorg.domain for uri/etc defaults. + + + + + + + + diff --git a/x4o-driver/src/test/java/org/x4o/xml/test/element/TestElementAttributeHandler.java b/x4o-driver/src/test/java/org/x4o/xml/test/element/TestElementNamespaceAttribute.java similarity index 91% rename from x4o-driver/src/test/java/org/x4o/xml/test/element/TestElementAttributeHandler.java rename to x4o-driver/src/test/java/org/x4o/xml/test/element/TestElementNamespaceAttribute.java index 119e126..2cf47d6 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/test/element/TestElementAttributeHandler.java +++ b/x4o-driver/src/test/java/org/x4o/xml/test/element/TestElementNamespaceAttribute.java @@ -22,7 +22,7 @@ */ package org.x4o.xml.test.element; -import org.x4o.xml.element.AbstractElementAttributeHandler; +import org.x4o.xml.element.AbstractElementNamespaceAttribute; import org.x4o.xml.element.Element; import org.x4o.xml.element.ElementConfiguratorException; @@ -32,7 +32,7 @@ import org.x4o.xml.element.ElementConfiguratorException; * @author Willem Cazander * @version 1.0 Aug 27, 2012 */ -public class TestElementAttributeHandler extends AbstractElementAttributeHandler { +public class TestElementNamespaceAttribute extends AbstractElementNamespaceAttribute { public void doConfigElement(Element element) throws ElementConfiguratorException { diff --git a/x4o-driver/src/test/resources/META-INF/junit-defd/defd-lang.eld b/x4o-driver/src/test/resources/META-INF/junit-defd/defd-lang.eld index 91c7d57..4ed4acf 100644 --- a/x4o-driver/src/test/resources/META-INF/junit-defd/defd-lang.eld +++ b/x4o-driver/src/test/resources/META-INF/junit-defd/defd-lang.eld @@ -64,26 +64,11 @@ - - - Configs the JComponent based objects. - - Binds the JComponent to the JComponent. - - Test the global element configurator. - - Test the global element attribute1 handler. - - - Test the global element attribute2 handler. - - - + + Test the global element attribute1 handler. + + + Test the global element attribute2 handler. + + + diff --git a/x4o-driver/src/test/resources/META-INF/test/test-lang.eld b/x4o-driver/src/test/resources/META-INF/test/test-lang.eld index 6690321..cc00f84 100644 --- a/x4o-driver/src/test/resources/META-INF/test/test-lang.eld +++ b/x4o-driver/src/test/resources/META-INF/test/test-lang.eld @@ -72,20 +72,6 @@ - - + diff --git a/x4o-driver/src/test/resources/META-INF/x4o-drivers.xml b/x4o-driver/src/test/resources/META-INF/x4o-drivers.xml index 72b54f1..794ab54 100644 --- a/x4o-driver/src/test/resources/META-INF/x4o-drivers.xml +++ b/x4o-driver/src/test/resources/META-INF/x4o-drivers.xml @@ -44,7 +44,7 @@ - + diff --git a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java index 8a35642..6134dc7 100644 --- a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java +++ b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java @@ -35,7 +35,7 @@ import org.x4o.xml.eld.doc.api.DefaultPageWriterTree; import org.x4o.xml.eld.doc.api.dom.ApiDoc; import org.x4o.xml.eld.doc.api.dom.ApiDocConcept; import org.x4o.xml.eld.doc.api.dom.ApiDocNode; -import org.x4o.xml.element.ElementAttributeHandler; +import org.x4o.xml.element.ElementNamespaceAttribute; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; @@ -136,7 +136,7 @@ public class EldDocWriter { ApiDocConcept adcEc = doc.addConcept(new ApiDocConcept(adcNs,C_ELEMENT,ElementClass.class)); // mm maybe redo something here - adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_ATTRIBUTE_H,ElementAttributeHandler.class)); + adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_ATTRIBUTE_H,ElementNamespaceAttribute.class)); adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_CONFIGURATOR_G,ElementConfiguratorGlobal.class)); adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_BINDING,ElementBindingHandler.class)); adcIface.addChildConcepts(new ApiDocConcept(adcMod,CC_ATTRIBUTE,ElementClassAttribute.class)); @@ -153,12 +153,12 @@ public class EldDocWriter { doc.setRootNode(rootNode); for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) { ApiDocNode modNode = rootNode.addNode(createNodeLanguageModule(mod)); for (ElementBindingHandler bind:mod.getElementBindingHandlers()) { modNode.addNode(createNodeElementBindingHandler(bind)); } - for (ElementAttributeHandler attr:mod.getElementAttributeHandlers()) { modNode.addNode(createNodeElementAttributeHandler(attr)); } for (ElementConfiguratorGlobal conf:mod.getElementConfiguratorGlobals()) { modNode.addNode(createNodeElementConfiguratorGlobal(conf)); } for (ElementInterface iface:mod.getElementInterfaces()) { ApiDocNode ifaceNode = modNode.addNode(createNodeElementInterface(iface)); for (ElementClassAttribute eca:iface.getElementClassAttributes()) { ifaceNode.addNode(createNodeElementClassAttribute(eca)); } for (ElementConfigurator conf:iface.getElementConfigurators()) { ifaceNode.addNode(createNodeElementConfigurator(conf)); } } for (ElementNamespace ns:mod.getElementNamespaces()) { ApiDocNode nsNode = modNode.addNode(createNodeElementNamespace(ns)); + for (ElementNamespaceAttribute attr:ns.getElementNamespaceAttributes()) { nsNode.addNode(createNodeElementNamespaceAttribute(attr)); } for (ElementClass ec:ns.getElementClasses()) { ApiDocNode ecNode = nsNode.addNode(createNodeElementClass(ec)); for (ElementClassAttribute eca:ec.getElementClassAttributes()) { ecNode.addNode(createNodeElementClassAttribute(eca)); } for (ElementConfigurator conf:ec.getElementConfigurators()) { ecNode.addNode(createNodeElementConfigurator(conf)); } } } @@ -169,7 +169,7 @@ public class EldDocWriter { private ApiDocNode createNodeElementBindingHandler(ElementBindingHandler bind) { return new ApiDocNode(bind,bind.getId(),bind.getId(),bind.getDescription()); } - private ApiDocNode createNodeElementAttributeHandler(ElementAttributeHandler attr) { + private ApiDocNode createNodeElementNamespaceAttribute(ElementNamespaceAttribute attr) { return new ApiDocNode(attr,attr.getId(),attr.getId(),attr.getDescription()); } private ApiDocNode createNodeElementConfiguratorGlobal(ElementConfiguratorGlobal conf) { diff --git a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguage.java b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguage.java index d2a20c7..b95e2bb 100644 --- a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguage.java +++ b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguage.java @@ -76,13 +76,13 @@ public class EldDocWriterLanguage extends AbstractApiDocWriter { int elements = 0; int namespaces = 0; for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) { - attrHandlers += mod.getElementAttributeHandlers().size(); bindHandlers += mod.getElementBindingHandlers().size(); interFaces += mod.getElementInterfaces().size(); eleConfigs += mod.getElementConfiguratorGlobals().size(); for (ElementNamespace ns:mod.getElementNamespaces()) { namespaces++; elements += ns.getElementClasses().size(); + attrHandlers += ns.getElementNamespaceAttributes().size(); } } writer.docTableStart("Language Summary", "Language Stats Summary.",ApiDocContentCss.overviewSummary); @@ -90,10 +90,10 @@ public class EldDocWriterLanguage extends AbstractApiDocWriter { writer.docTableRow("LanguageName:", ""+context.getLanguage().getLanguageName(), null); writer.docTableRow("LanguageVersion:",""+context.getLanguage().getLanguageVersion(),null); writer.docTableRow("Modules:",""+context.getLanguage().getLanguageModules().size(),null); - writer.docTableRow("Namespaces:",""+namespaces,null); writer.docTableRow("Elements:",""+elements,null); + writer.docTableRow("ElementNamespaces:",""+namespaces,null); + writer.docTableRow("ElementNamespaceAttribute:",""+attrHandlers,null); writer.docTableRow("ElementInterfaces:",""+interFaces,null); - writer.docTableRow("ElementAttributeHandlers:",""+attrHandlers,null); writer.docTableRow("ElementBindingHandlers:",""+bindHandlers,null); writer.docTableRow("ElementConfigurators:",""+eleConfigs,null); writer.docTableEnd(); diff --git a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguageModule.java b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguageModule.java index e4cc4f9..f793068 100644 --- a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguageModule.java +++ b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriterLanguageModule.java @@ -30,7 +30,7 @@ import org.x4o.xml.eld.doc.api.dom.ApiDocNode; import org.x4o.xml.eld.doc.api.dom.ApiDocNodeBody; import org.x4o.xml.eld.doc.api.dom.ApiDocNodeData; import org.x4o.xml.eld.doc.api.dom.ApiDocWriteEvent; -import org.x4o.xml.element.ElementAttributeHandler; +import org.x4o.xml.element.ElementNamespaceAttribute; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementConfigurator; import org.x4o.xml.element.ElementInterface; @@ -50,7 +50,7 @@ public class EldDocWriterLanguageModule extends AbstractApiDocWriter { public void configNavBar(ApiDoc doc,ApiDocNode node,ApiDocNodeData data) { clearHrefContentGroup(doc,node,"summary","interface",ElementInterface.class); clearHrefContentGroup(doc,node,"summary","binding",ElementBindingHandler.class); - clearHrefContentGroup(doc,node,"summary","attribute",ElementAttributeHandler.class); + clearHrefContentGroup(doc,node,"summary","attribute",ElementNamespaceAttribute.class); clearHrefContentGroup(doc,node,"summary","configurator",ElementConfigurator.class); clearHrefContentGroup(doc,node,"summary","namespace",ElementNamespace.class); } @@ -67,7 +67,7 @@ public class EldDocWriterLanguageModule extends AbstractApiDocWriter { @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={3},contentGroup="attribute",contentGroupType="summary") public void writeAttributeSummary(ApiDocWriteEvent event) throws SAXException { - printApiTable(event,"Attribute Summary",ElementAttributeHandler.class); + printApiTable(event,"Attribute Summary",ElementNamespaceAttribute.class); } @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary") diff --git a/x4o-meta/src/main/java/org/x4o/xml/lang/meta/ELIDAttributeHandler.java b/x4o-meta/src/main/java/org/x4o/xml/lang/meta/ELIDAttributeHandler.java index 8f46fd4..6583076 100644 --- a/x4o-meta/src/main/java/org/x4o/xml/lang/meta/ELIDAttributeHandler.java +++ b/x4o-meta/src/main/java/org/x4o/xml/lang/meta/ELIDAttributeHandler.java @@ -26,7 +26,7 @@ import java.util.logging.Logger; import javax.el.ValueExpression; -import org.x4o.xml.element.AbstractElementAttributeHandler; +import org.x4o.xml.element.AbstractElementNamespaceAttribute; import org.x4o.xml.element.Element; import org.x4o.xml.element.ElementConfiguratorException; @@ -37,7 +37,7 @@ import org.x4o.xml.element.ElementConfiguratorException; * @author Willem Cazander * @version 1.0 Aug 23, 2006 */ -public class ELIDAttributeHandler extends AbstractElementAttributeHandler { +public class ELIDAttributeHandler extends AbstractElementNamespaceAttribute { /** * @see org.x4o.xml.element.ElementConfigurator#doConfigElement(org.x4o.xml.element.Element)