diff --git a/x4o-core/src/main/java/org/x4o/xml/X4ODriver.java b/x4o-core/src/main/java/org/x4o/xml/X4ODriver.java index ec3e6b0..cfa08d2 100644 --- a/x4o-core/src/main/java/org/x4o/xml/X4ODriver.java +++ b/x4o-core/src/main/java/org/x4o/xml/X4ODriver.java @@ -25,17 +25,17 @@ package org.x4o.xml; import java.util.Collection; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.core.phase.X4OPhaseException; -import org.x4o.xml.core.phase.X4OPhaseType; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.io.DefaultX4OReader; import org.x4o.xml.io.DefaultX4OSchemaWriter; import org.x4o.xml.io.DefaultX4OWriter; import org.x4o.xml.io.X4OReader; import org.x4o.xml.io.X4OSchemaWriter; import org.x4o.xml.io.X4OWriter; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; +import org.x4o.xml.lang.phase.X4OPhaseException; +import org.x4o.xml.lang.phase.X4OPhaseType; /** * This is the starting point of the XML X4O Language Driver. @@ -69,13 +69,13 @@ public abstract class X4ODriver { return result; } - public ElementLanguage createLanguageContext() { + public X4OLanguageContext createLanguageContext() { return createLanguageContext(getLanguageVersionDefault()); } - public ElementLanguage createLanguageContext(String version) { + public X4OLanguageContext createLanguageContext(String version) { X4OLanguage language = createLanguage(version); - ElementLanguage result = language.getLanguageConfiguration().createElementLanguage(this); + X4OLanguageContext result = language.getLanguageConfiguration().createElementLanguage(this); try { result.getLanguage().getPhaseManager().runPhases(result, X4OPhaseType.INIT); diff --git a/x4o-core/src/main/java/org/x4o/xml/X4ODriverManager.java b/x4o-core/src/main/java/org/x4o/xml/X4ODriverManager.java index 1c3c63e..ab6e499 100644 --- a/x4o-core/src/main/java/org/x4o/xml/X4ODriverManager.java +++ b/x4o-core/src/main/java/org/x4o/xml/X4ODriverManager.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Map; import java.util.logging.Logger; -import org.x4o.xml.core.config.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageClassLoader; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; diff --git a/x4o-core/src/main/java/org/x4o/xml/conv/text/ClassConverter.java b/x4o-core/src/main/java/org/x4o/xml/conv/text/ClassConverter.java index 281e717..7140ace 100644 --- a/x4o-core/src/main/java/org/x4o/xml/conv/text/ClassConverter.java +++ b/x4o-core/src/main/java/org/x4o/xml/conv/text/ClassConverter.java @@ -28,7 +28,7 @@ import java.util.Locale; import org.x4o.xml.conv.AbstractStringObjectConverter; import org.x4o.xml.conv.ObjectConverter; import org.x4o.xml.conv.ObjectConverterException; -import org.x4o.xml.core.config.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageClassLoader; /** * Converts a String of an className into the the Class object. diff --git a/x4o-core/src/main/java/org/x4o/xml/conv/text/EnumConverter.java b/x4o-core/src/main/java/org/x4o/xml/conv/text/EnumConverter.java index 24b2a06..37e310a 100644 --- a/x4o-core/src/main/java/org/x4o/xml/conv/text/EnumConverter.java +++ b/x4o-core/src/main/java/org/x4o/xml/conv/text/EnumConverter.java @@ -28,7 +28,7 @@ import java.util.Locale; import org.x4o.xml.conv.AbstractStringObjectConverter; import org.x4o.xml.conv.ObjectConverter; import org.x4o.xml.conv.ObjectConverterException; -import org.x4o.xml.core.config.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageClassLoader; /** * Converts Sring of an Enum into the enum value. diff --git a/x4o-core/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java b/x4o-core/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java index 72a5d09..1a4823f 100644 --- a/x4o-core/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java +++ b/x4o-core/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java @@ -33,7 +33,7 @@ import java.util.Locale; import org.x4o.xml.conv.AbstractStringObjectConverter; import org.x4o.xml.conv.ObjectConverter; import org.x4o.xml.conv.ObjectConverterException; -import org.x4o.xml.core.config.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageClassLoader; /** * StringSplitConverter. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/package-info.java b/x4o-core/src/main/java/org/x4o/xml/core/package-info.java deleted file mode 100644 index 7a35e7e..0000000 --- a/x4o-core/src/main/java/org/x4o/xml/core/package-info.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2004-2012, Willem Cazander - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * The core classes which startup the language. - * - * @since 1.0 - */ - -package org.x4o.xml.core; diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/CelDriver.java b/x4o-core/src/main/java/org/x4o/xml/eld/CelDriver.java index 65bbb20..01b2a50 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/CelDriver.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/CelDriver.java @@ -24,11 +24,11 @@ package org.x4o.xml.eld; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.DefaultX4OLanguage; -import org.x4o.xml.core.config.DefaultX4OLanguageConfiguration; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.phase.X4OPhaseManagerFactory; -import org.x4o.xml.element.ElementLanguageModule; +import org.x4o.xml.lang.DefaultX4OLanguage; +import org.x4o.xml.lang.DefaultX4OLanguageConfiguration; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.phase.X4OPhaseManagerFactory; /** @@ -37,7 +37,7 @@ import org.x4o.xml.element.ElementLanguageModule; * @author Willem Cazander * @version 1.0 Aug 20, 2005 */ -public class CelDriver extends X4ODriver { +public class CelDriver extends X4ODriver { /** Defines the identifier of the 'Core Element Language' language. */ public static final String LANGUAGE_NAME = "cel"; diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/EldDriver.java b/x4o-core/src/main/java/org/x4o/xml/eld/EldDriver.java index 4d974a0..c1111b2 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/EldDriver.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/EldDriver.java @@ -24,11 +24,11 @@ package org.x4o.xml.eld; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.DefaultX4OLanguage; -import org.x4o.xml.core.config.DefaultX4OLanguageConfiguration; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.phase.X4OPhaseManagerFactory; -import org.x4o.xml.element.ElementLanguageModule; +import org.x4o.xml.lang.DefaultX4OLanguage; +import org.x4o.xml.lang.DefaultX4OLanguageConfiguration; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.phase.X4OPhaseManagerFactory; /** @@ -38,7 +38,7 @@ import org.x4o.xml.element.ElementLanguageModule; * @author Willem Cazander * @version 1.0 Aug 20, 2005 */ -public class EldDriver extends X4ODriver { +public class EldDriver extends X4ODriver { /** Defines the identifier of the 'Element Language Description' language. */ public static final String LANGUAGE_NAME = "eld"; diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoader.java b/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoader.java index 043bac7..18c2b70 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoader.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoader.java @@ -31,13 +31,13 @@ import javax.xml.parsers.ParserConfigurationException; import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.core.config.X4OLanguageLocal; -import org.x4o.xml.element.ElementLanguage; -import org.x4o.xml.element.ElementLanguageModule; -import org.x4o.xml.element.ElementLanguageModuleLoader; -import org.x4o.xml.element.ElementLanguageModuleLoaderException; import org.x4o.xml.io.DefaultX4OReader; import org.x4o.xml.io.X4OReader; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageModuleLoader; +import org.x4o.xml.lang.X4OLanguageModuleLoaderException; +import org.x4o.xml.lang.X4OLanguageLocal; import org.xml.sax.SAXException; /** @@ -46,7 +46,7 @@ import org.xml.sax.SAXException; * @author Willem Cazander * @version 1.0 Aug 17, 2005 */ -public class EldModuleLoader implements ElementLanguageModuleLoader { +public class EldModuleLoader implements X4OLanguageModuleLoader { private Logger logger = null; private String eldResource = null; @@ -81,46 +81,45 @@ public class EldModuleLoader implements ElementLanguageModuleLoader { * Loads the ELD language into the module. * @param elementLanguage The langauge to load for. * @param elementLanguageModule The module to load it in. - * @throws ElementLanguageModuleLoaderException When eld language could not be loaded. - * @see org.x4o.xml.element.ElementLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.element.ElementLanguageModule) + * @throws X4OLanguageModuleLoaderException When eld language could not be loaded. + * @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageContext, org.x4o.xml.lang.X4OLanguageModule) */ - public void loadLanguageModule(X4OLanguageLocal language,ElementLanguageModule elementLanguageModule) throws ElementLanguageModuleLoaderException { + public void loadLanguageModule(X4OLanguageLocal language,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException { logger.fine("Loading name eld file from resource: "+eldResource); try { //EldDriver parser = new EldDriver(elementLanguage,elementLanguageModule,isEldCore); - X4ODriver driver = null; + X4ODriver driver = null; if (isEldCore) { driver = X4ODriverManager.getX4ODriver(CelDriver.LANGUAGE_NAME); } else { driver = X4ODriverManager.getX4ODriver(EldDriver.LANGUAGE_NAME); } - ElementLanguage eldLang = driver.createLanguageContext(driver.getLanguageVersionDefault()); - X4OReader reader = new DefaultX4OReader(eldLang); //driver.createReader(); - + X4OLanguageContext eldLang = driver.createLanguageContext(driver.getLanguageVersionDefault()); + X4OReader reader = new DefaultX4OReader(eldLang); reader.addELBeanInstance(EL_PARENT_LANGUAGE_CONFIGURATION, language.getLanguageConfiguration()); reader.addELBeanInstance(EL_PARENT_LANGUAGE, language); reader.addELBeanInstance(EL_PARENT_ELEMENT_LANGUAGE_MODULE, elementLanguageModule); -// TODO: if (language.getLanguageConfiguration().getLanguagePropertyBoolean(X4OLanguageProperty.DEBUG_OUTPUT_ELD_PARSER)) { +//TODO: if (language.getLanguageConfiguration().getLanguagePropertyBoolean(X4OLanguageProperty.DEBUG_OUTPUT_ELD_PARSER)) { // eldLang.setX4ODebugWriter(elementLanguage.getLanguageConfiguration().getX4ODebugWriter()); // } reader.readResource(eldResource); } catch (FileNotFoundException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); } catch (SecurityException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); } catch (NullPointerException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); } catch (ParserConfigurationException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); } catch (SAXException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); } catch (IOException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage()+" while parsing: "+eldResource,e); } } } diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java b/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java index a048ad6..026bc83 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/EldModuleLoaderCore.java @@ -28,9 +28,6 @@ import java.util.List; import java.util.logging.Logger; import org.x4o.xml.conv.text.ClassConverter; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguageClassLoader; -import org.x4o.xml.core.config.X4OLanguageLocal; import org.x4o.xml.eld.lang.BeanElement; import org.x4o.xml.eld.lang.DescriptionElement; import org.x4o.xml.eld.lang.ElementClassAddParentElement; @@ -40,16 +37,19 @@ import org.x4o.xml.eld.lang.ElementInterfaceBindingHandler; import org.x4o.xml.eld.lang.ElementModuleBindingHandler; import org.x4o.xml.eld.lang.ElementNamespaceContextBindingHandler; import org.x4o.xml.eld.lang.ModuleElement; +import org.x4o.xml.element.DefaultElementClass; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; -import org.x4o.xml.element.ElementLanguageModule; -import org.x4o.xml.element.ElementLanguageModuleLoader; -import org.x4o.xml.element.ElementLanguageModuleLoaderException; import org.x4o.xml.element.ElementNamespaceContext; import org.x4o.xml.element.ElementNamespaceInstanceProvider; import org.x4o.xml.element.ElementNamespaceInstanceProviderException; -import org.x4o.xml.impl.DefaultElementClass; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageModuleLoader; +import org.x4o.xml.lang.X4OLanguageModuleLoaderException; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageLocal; /** * EldModuleLoaderCore provides a few basic elements for the core eld x4o language. @@ -57,7 +57,7 @@ import org.x4o.xml.impl.DefaultElementClass; * @author Willem Cazander * @version 1.0 Jan 11, 2009 */ -public class EldModuleLoaderCore implements ElementLanguageModuleLoader { +public class EldModuleLoaderCore implements X4OLanguageModuleLoader { private Logger logger = null; private static final String PP_CEL_PROVIDER = "cel.x4o.org"; @@ -83,9 +83,9 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { * Loads the CEL language into the module. * @param elementLanguage The langauge to load for. * @param elementLanguageModule The module to load it in. - * @see org.x4o.xml.element.ElementLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.element.ElementLanguageModule) + * @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.lang.X4OLanguageModule) */ - public void loadLanguageModule(X4OLanguageLocal language,ElementLanguageModule elementLanguageModule) throws ElementLanguageModuleLoaderException { + public void loadLanguageModule(X4OLanguageLocal language,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException { elementLanguageModule.setId("cel-module"); elementLanguageModule.setName("Core Element Languag Module"); @@ -130,18 +130,18 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { try { namespace = (ElementNamespaceContext)X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementNamespaceContext()); } catch (InstantiationException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } catch (IllegalAccessException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } try { namespace.setElementNamespaceInstanceProvider((ElementNamespaceInstanceProvider) X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider()) ); } catch (InstantiationException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } catch (IllegalAccessException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } namespace.setId(CEL_CORE); @@ -164,7 +164,7 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { try { namespace.getElementNamespaceInstanceProvider().start(language, namespace); } catch (ElementNamespaceInstanceProviderException e) { - throw new ElementLanguageModuleLoaderException(this,"Error starting instance provider: "+e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,"Error starting instance provider: "+e.getMessage(),e); } elementLanguageModule.addElementNamespaceContext(namespace); @@ -174,18 +174,18 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { try { namespace = (ElementNamespaceContext)X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementNamespaceContext()); } catch (InstantiationException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } catch (IllegalAccessException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } try { namespace.setElementNamespaceInstanceProvider((ElementNamespaceInstanceProvider) X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider()) ); } catch (InstantiationException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } catch (IllegalAccessException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } namespace.setId(CEL_ROOT); @@ -198,7 +198,7 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { try { namespace.getElementNamespaceInstanceProvider().start(language, namespace); } catch (ElementNamespaceInstanceProviderException e) { - throw new ElementLanguageModuleLoaderException(this,"Error starting instance provider: "+e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,"Error starting instance provider: "+e.getMessage(),e); } elementLanguageModule.addElementNamespaceContext(namespace); } @@ -207,9 +207,9 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { * Adds only Element class beans which need extra meta info for schema. * * @param elementClassList The list to fill. - * @throws ElementLanguageModuleLoaderException + * @throws X4OLanguageModuleLoaderException */ - private void createElementClasses(List elementClassList,X4OLanguage language) throws ElementLanguageModuleLoaderException { + private void createElementClasses(List elementClassList,X4OLanguage language) throws X4OLanguageModuleLoaderException { ElementClass ec = null; ElementClassAttribute attr = null; @@ -287,15 +287,15 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { * Creates new ElementClassAttribute instance. * @param elementLanguage The ElementLanguage to create from. * @return The new ElementClassAttribute instance. - * @throws ElementLanguageModuleLoaderException When class could not be created. + * @throws X4OLanguageModuleLoaderException When class could not be created. */ - private ElementClassAttribute newElementClassAttribute(X4OLanguage language) throws ElementLanguageModuleLoaderException { + private ElementClassAttribute newElementClassAttribute(X4OLanguage language) throws X4OLanguageModuleLoaderException { try { return (ElementClassAttribute)X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementClassAttribute()); } catch (InstantiationException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } catch (IllegalAccessException e) { - throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e); + throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e); } } @@ -305,7 +305,7 @@ public class EldModuleLoaderCore implements ElementLanguageModuleLoader { * @param handler The handler to add the the module. * @param elementLanguageModule The module to add the handler to. */ - private void addBindingHandler(String id,ElementBindingHandler handler,ElementLanguageModule elementLanguageModule) { + private void addBindingHandler(String id,ElementBindingHandler handler,X4OLanguageModule elementLanguageModule) { handler.setId(id); elementLanguageModule.addElementBindingHandler(handler); } diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/lang/BeanElement.java b/x4o-core/src/main/java/org/x4o/xml/eld/lang/BeanElement.java index b9397eb..2a5a534 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/lang/BeanElement.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/lang/BeanElement.java @@ -28,9 +28,9 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; -import org.x4o.xml.core.config.X4OLanguageClassLoader; import org.x4o.xml.element.AbstractElement; import org.x4o.xml.element.ElementException; +import org.x4o.xml.lang.X4OLanguageClassLoader; /** * BeanElement fills it elementObject from source with the bean.class attribute. diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java b/x4o-core/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java index 2b8b053..d2cd0c8 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/lang/ElementModuleBindingHandler.java @@ -25,9 +25,6 @@ package org.x4o.xml.eld.lang; import java.util.Map; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguageClassLoader; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.eld.EldModuleLoader; import org.x4o.xml.element.AbstractElementBindingHandler; import org.x4o.xml.element.Element; @@ -35,12 +32,14 @@ import org.x4o.xml.element.ElementAttributeHandler; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementBindingHandlerException; import org.x4o.xml.element.ElementConfiguratorGlobal; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; import org.x4o.xml.element.ElementNamespaceInstanceProvider; import org.x4o.xml.element.ElementNamespaceInstanceProviderException; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageProperty; /** * An ParentLanguageElementConfigurator. @@ -65,7 +64,7 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() */ public Class getBindParentClass() { - return ElementLanguageModule.class; + return X4OLanguageModule.class; } /** @@ -87,7 +86,7 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler } X4OLanguage x4oParsingContext = (X4OLanguage)m.get(EldModuleLoader.EL_PARENT_LANGUAGE); //ElementLanguageModule elementLanguageModule = (ElementLanguageModule)m.get(EldParser.PARENT_ELEMENT_LANGUAGE_MODULE); - ElementLanguageModule elementLanguageModule = (ElementLanguageModule)parentObject; + X4OLanguageModule elementLanguageModule = (X4OLanguageModule)parentObject; if (x4oParsingContext==null) { return; } diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/lang/ModuleElement.java b/x4o-core/src/main/java/org/x4o/xml/eld/lang/ModuleElement.java index b0f5d12..52687aa 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/lang/ModuleElement.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/lang/ModuleElement.java @@ -25,11 +25,11 @@ package org.x4o.xml.eld.lang; import java.util.Map; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.eld.EldModuleLoader; import org.x4o.xml.element.AbstractElement; import org.x4o.xml.element.ElementException; -import org.x4o.xml.element.ElementLanguageModule; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageProperty; /** * ModuleElement put in an instance from parent language module. @@ -54,7 +54,7 @@ public class ModuleElement extends AbstractElement { if (m==null) { return; } - ElementLanguageModule elementLanguageModule = (ElementLanguageModule)m.get(EldModuleLoader.EL_PARENT_ELEMENT_LANGUAGE_MODULE); + X4OLanguageModule elementLanguageModule = (X4OLanguageModule)m.get(EldModuleLoader.EL_PARENT_ELEMENT_LANGUAGE_MODULE); setElementObject(elementLanguageModule); } } diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlGenerator.java b/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlGenerator.java index 76d684c..9418064 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlGenerator.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlGenerator.java @@ -26,12 +26,12 @@ package org.x4o.xml.eld.xsd; import java.io.File; import java.io.FileOutputStream; -import org.x4o.xml.core.config.X4OLanguage; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementException; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; import org.x4o.xml.io.sax.XMLWriter; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguage; import org.xml.sax.SAXException; import org.xml.sax.ext.DefaultHandler2; @@ -76,7 +76,7 @@ public class EldXsdXmlGenerator { } return; } - for (ElementLanguageModule mod:language.getElementLanguageModules()) { + for (X4OLanguageModule mod:language.getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { checkNamespace(ns); FileOutputStream fio = new FileOutputStream(new File(basePath.getAbsolutePath()+File.separatorChar+ns.getSchemaResource())); diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java b/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java index 91dc6ed..e925698 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/xsd/EldXsdXmlWriter.java @@ -33,14 +33,14 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.x4o.xml.core.config.X4OLanguage; import org.x4o.xml.element.ElementAttributeHandler; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguage; import org.xml.sax.SAXException; import org.xml.sax.ext.DefaultHandler2; import org.xml.sax.helpers.AttributesImpl; @@ -110,13 +110,13 @@ public class EldXsdXmlWriter { this.namespaces.clear(); // redo this mess, add nice find for binding handlers - for (ElementLanguageModule modContext:language.getElementLanguageModules()) { + for (X4OLanguageModule modContext:language.getLanguageModules()) { for (ElementNamespaceContext nsContext:modContext.getElementNamespaceContexts()) { for (ElementClass ec:nsContext.getElementClasses()) { Class objectClass = null; if (ec.getObjectClass()!=null) { objectClass = ec.getObjectClass(); - for (ElementLanguageModule mod:language.getElementLanguageModules()) { + for (X4OLanguageModule mod:language.getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { for (ElementClass checkClass:ns.getElementClasses()) { if (checkClass.getObjectClass()==null) { @@ -180,8 +180,8 @@ public class EldXsdXmlWriter { msg = "\n".toCharArray(); xmlWriter.ignorableWhitespace(msg,0,msg.length); - ElementLanguageModule module = null; - for (ElementLanguageModule elm:language.getElementLanguageModules()) { + X4OLanguageModule module = null; + for (X4OLanguageModule elm:language.getLanguageModules()) { ElementNamespaceContext s = elm.getElementNamespaceContext(ns.getUri()); if (s!=null) { module = elm; @@ -272,7 +272,7 @@ public class EldXsdXmlWriter { atts.addAttribute ("", "maxOccurs", "", "", "unbounded"); xmlWriter.startElement (SCHEMA_URI, "choice", "", atts); - for (ElementLanguageModule mod:language.getElementLanguageModules()) { + for (X4OLanguageModule mod:language.getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { writeElementClassNamespaces(ec,nsWrite,ns); } @@ -293,7 +293,7 @@ public class EldXsdXmlWriter { xmlWriter.endElement(SCHEMA_URI, "attribute", ""); } - for (ElementLanguageModule mod:language.getElementLanguageModules()) { + for (X4OLanguageModule mod:language.getLanguageModules()) { for (ElementAttributeHandler eah:mod.getElementAttributeHandlers()) { attrNames.add(eah.getAttributeName()); atts = new AttributesImpl(); diff --git a/x4o-core/src/main/java/org/x4o/xml/eld/xsd/X4OSchemaWriterExecutor.java b/x4o-core/src/main/java/org/x4o/xml/eld/xsd/X4OSchemaWriterExecutor.java index 1e6ac93..41ffcb5 100644 --- a/x4o-core/src/main/java/org/x4o/xml/eld/xsd/X4OSchemaWriterExecutor.java +++ b/x4o-core/src/main/java/org/x4o/xml/eld/xsd/X4OSchemaWriterExecutor.java @@ -54,13 +54,13 @@ public class X4OSchemaWriterExecutor { String arg = arguIterator.next(); if ("-path".equals(arg) || "-p".equals(arg)) { if (arguIterator.hasNext()==false) { - System.out.println("No argument for "+arg+" given."); + System.err.println("No argument for "+arg+" given."); System.exit(1); return; } File schemaBasePath = new File(arguIterator.next()); if (schemaBasePath.exists()==false) { - System.out.println("path does not exists; "+schemaBasePath); + System.err.println("path does not exists; "+schemaBasePath); System.exit(1); return; } @@ -69,7 +69,7 @@ public class X4OSchemaWriterExecutor { } if ("-language".equals(arg) || "-l".equals(arg)) { if (arguIterator.hasNext()==false) { - System.out.println("No argument for "+arg+" given."); + System.err.println("No argument for "+arg+" given."); System.exit(1); return; } @@ -91,7 +91,7 @@ public class X4OSchemaWriterExecutor { e = e3; } if (e!=null) { - System.out.println("Error while schema writing: "+e.getMessage()); + System.err.println("Error while schema writing: "+e.getMessage()); if (printStack) { e.printStackTrace(); } diff --git a/x4o-core/src/main/java/org/x4o/xml/element/AbstractElement.java b/x4o-core/src/main/java/org/x4o/xml/element/AbstractElement.java index 095f048..0c18615 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/AbstractElement.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/AbstractElement.java @@ -28,7 +28,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.x4o.xml.core.config.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageClassLoader; /** * An AbstractElement. @@ -43,7 +44,7 @@ public abstract class AbstractElement implements Element { /** The config object */ private Object elementObject = null; /** The language parsing context */ - private ElementLanguage elementLanguage = null; + private X4OLanguageContext elementLanguage = null; /** The ElementClass */ private ElementClass elementClass = null; /** The attributes */ @@ -93,7 +94,7 @@ public abstract class AbstractElement implements Element { getAttributes().clear(); setElementClass(null); setParent(null); - setElementLanguage(null); + setLanguageContext(null); attributes.clear(); childeren.clear(); // we do not release childeren, x4o does that allChilderen.clear(); @@ -114,16 +115,16 @@ public abstract class AbstractElement implements Element { } /** - * @see Element#setElementLanguage(ElementLanguage) + * @see Element#setLanguageContext(X4OLanguageContext) */ - public void setElementLanguage(ElementLanguage elementLanguage) { + public void setLanguageContext(X4OLanguageContext elementLanguage) { this.elementLanguage=elementLanguage; } /** * @see Element#getElementLanguage() */ - public ElementLanguage getElementLanguage() { + public X4OLanguageContext getElementLanguage() { return elementLanguage; } diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElement.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElement.java similarity index 95% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElement.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElement.java index 489855a..f6009f0 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElement.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElement.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElement; /** * The default element to handle the xml events. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementAttributeValueParser.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementAttributeValueParser.java similarity index 92% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementAttributeValueParser.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementAttributeValueParser.java index 1b788bd..bb203d9 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementAttributeValueParser.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementAttributeValueParser.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; import java.util.Locale; import java.util.logging.Logger; @@ -29,11 +29,6 @@ import java.util.logging.Logger; import javax.el.ValueExpression; import org.x4o.xml.conv.ObjectConverterException; -import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementAttributeValueParser; -import org.x4o.xml.element.ElementAttributeValueParserException; -import org.x4o.xml.element.ElementClassAttribute; -import org.x4o.xml.element.ElementInterface; /** @@ -112,8 +107,8 @@ public class DefaultElementAttributeValueParser implements ElementAttributeValue * @see org.x4o.xml.element.ElementAttributeValueParser#getELParameterValue(java.lang.String, org.x4o.xml.element.Element) */ public Object getELParameterValue(String value, Element element) throws ElementAttributeValueParserException { - ValueExpression e = element.getElementLanguage().getExpressionFactory().createValueExpression(element.getElementLanguage().getELContext(), (String)value,Object.class); - return e.getValue(element.getElementLanguage().getELContext()); + ValueExpression e = element.getElementLanguage().getExpressionLanguageFactory().createValueExpression(element.getElementLanguage().getExpressionLanguageContext(), (String)value,Object.class); + return e.getValue(element.getElementLanguage().getExpressionLanguageContext()); } /** diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyCharacters.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyCharacters.java similarity index 92% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyCharacters.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyCharacters.java index 978d06e..c8ab4a2 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyCharacters.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyCharacters.java @@ -21,17 +21,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementClass; -import org.x4o.xml.element.ElementLanguage; -import org.x4o.xml.element.ElementException; +import org.x4o.xml.lang.X4OLanguageContext; /** @@ -130,7 +127,7 @@ public class DefaultElementBodyCharacters implements Element { /** * @see org.x4o.xml.element.Element#getElementLanguage() */ - public ElementLanguage getElementLanguage() { + public X4OLanguageContext getElementLanguage() { return null; } @@ -180,9 +177,9 @@ public class DefaultElementBodyCharacters implements Element { } /** - * @see org.x4o.xml.element.Element#setElementLanguage(org.x4o.xml.element.ElementLanguage) + * @see org.x4o.xml.element.Element#setLanguageContext(org.x4o.xml.lang.X4OLanguageContext) */ - public void setElementLanguage(ElementLanguage elementLanguage) { + public void setLanguageContext(X4OLanguageContext elementLanguage) { } /** diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyComment.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyComment.java similarity index 96% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyComment.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyComment.java index 39fa096..f09398c 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyComment.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyComment.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElement; /** * DefaultElementBodyComment the default comment element. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyWhitespace.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyWhitespace.java similarity index 96% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyWhitespace.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyWhitespace.java index a1262e7..2aac3fb 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementBodyWhitespace.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementBodyWhitespace.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElement; /** * DefaultElementBodyWhitespace the default white space element. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementClass.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementClass.java similarity index 96% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementClass.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementClass.java index 72bb03e..3cc1d77 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementClass.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementClass.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElementClass; /** * The default ElementClass to store the Element information. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementClassAttribute.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementClassAttribute.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementClassAttribute.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementClassAttribute.java index 31ee001..c885c17 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementClassAttribute.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementClassAttribute.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElementClassAttribute; /** * The default ElementClassAttribute. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementInterface.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementInterface.java similarity index 95% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementInterface.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementInterface.java index ed0c82c..1256fff 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementInterface.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementInterface.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElementInterface; /** * The default ElementInterface to store config based on class interface. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementNamespaceContext.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementNamespaceContext.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementNamespaceContext.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementNamespaceContext.java index 44115ef..3123fdb 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementNamespaceContext.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementNamespaceContext.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; -import org.x4o.xml.element.AbstractElementNamespaceContext; /** * The default namespace context. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementNamespaceInstanceProvider.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementNamespaceInstanceProvider.java similarity index 86% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementNamespaceInstanceProvider.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementNamespaceInstanceProvider.java index 04b5709..02eb2f8 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementNamespaceInstanceProvider.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementNamespaceInstanceProvider.java @@ -21,18 +21,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; import java.util.logging.Logger; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguageClassLoader; -import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementClass; -import org.x4o.xml.element.ElementLanguage; -import org.x4o.xml.element.ElementNamespaceContext; -import org.x4o.xml.element.ElementNamespaceInstanceProvider; -import org.x4o.xml.element.ElementNamespaceInstanceProviderException; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.X4OLanguageClassLoader; /** * DefaultElementNamespaceInstanceProvider creates and configures an Element instance. @@ -55,7 +50,7 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace /** * @param language The elementLanguage of this provider. * @param elementNamespaceContext The elementNamespaceContext for this provider. - * @see org.x4o.xml.element.ElementNamespaceInstanceProvider#start(org.x4o.xml.element.ElementLanguage, org.x4o.xml.element.ElementNamespaceContext) + * @see org.x4o.xml.element.ElementNamespaceInstanceProvider#start(org.x4o.xml.lang.X4OLanguageContext, org.x4o.xml.element.ElementNamespaceContext) */ public void start(X4OLanguage language,ElementNamespaceContext elementNamespaceContext) { this.elementNamespaceContext=elementNamespaceContext; @@ -68,7 +63,7 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace * @throws ElementNamespaceInstanceProviderException * @see org.x4o.xml.element.ElementNamespaceInstanceProvider#createElementInstance(java.lang.String) */ - public Element createElementInstance(ElementLanguage elementLanguage,String tag) throws ElementNamespaceInstanceProviderException { + public Element createElementInstance(X4OLanguageContext elementLanguage,String tag) throws ElementNamespaceInstanceProviderException { ElementClass elementClass = elementNamespaceContext.getElementClass(tag); Element element = null; @@ -98,7 +93,7 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace throw new ElementNamespaceInstanceProviderException(this,"Error while providing Element: "+e.getMessage(),e); } */ element.setElementClass(elementClass); - element.setElementLanguage(elementLanguage); + element.setLanguageContext(elementLanguage); return element; } } diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementObjectPropertyValue.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementObjectPropertyValue.java similarity index 98% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementObjectPropertyValue.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultElementObjectPropertyValue.java index 9b413fe..c938d55 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementObjectPropertyValue.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultElementObjectPropertyValue.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; import java.io.Serializable; import java.lang.reflect.Method; @@ -33,8 +33,6 @@ import java.util.logging.Logger; import org.x4o.xml.conv.DefaultObjectConverterProvider; import org.x4o.xml.conv.ObjectConverter; import org.x4o.xml.conv.ObjectConverterException; -import org.x4o.xml.element.ElementObjectPropertyValue; -import org.x4o.xml.element.ElementObjectPropertyValueException; /** * An DefaultElementObjectPropertyValue which does does get/set operations on pojo beans. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultGlobalAttributeHandlerComparator.java b/x4o-core/src/main/java/org/x4o/xml/element/DefaultGlobalAttributeHandlerComparator.java similarity index 96% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultGlobalAttributeHandlerComparator.java rename to x4o-core/src/main/java/org/x4o/xml/element/DefaultGlobalAttributeHandlerComparator.java index 3d85aea..771e334 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultGlobalAttributeHandlerComparator.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/DefaultGlobalAttributeHandlerComparator.java @@ -21,11 +21,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; import java.util.Comparator; -import org.x4o.xml.element.ElementAttributeHandler; /** diff --git a/x4o-core/src/main/java/org/x4o/xml/element/Element.java b/x4o-core/src/main/java/org/x4o/xml/element/Element.java index 1924884..6f0d62b 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/Element.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/Element.java @@ -27,6 +27,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.x4o.xml.lang.X4OLanguageContext; + /** * Defines an XML element with an object.
*
@@ -134,13 +136,13 @@ public interface Element { * Sets the ElementLanguage. * @param elementLanguage The ElementLanguage to set. */ - void setElementLanguage(ElementLanguage elementLanguage); + void setLanguageContext(X4OLanguageContext elementLanguage); /** * Gets the ElementLanguage. * @return Returns the ElementLanguage. */ - ElementLanguage getElementLanguage(); + X4OLanguageContext getElementLanguage(); /** * Sets the body texts on an event based system. diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementNamespaceInstanceProvider.java b/x4o-core/src/main/java/org/x4o/xml/element/ElementNamespaceInstanceProvider.java index a88545a..b9f389b 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementNamespaceInstanceProvider.java +++ b/x4o-core/src/main/java/org/x4o/xml/element/ElementNamespaceInstanceProvider.java @@ -23,7 +23,8 @@ package org.x4o.xml.element; -import org.x4o.xml.core.config.X4OLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguage; /** * ElementNamespaceInstanceProvider is provider for creating new Element instances for an xml tag.
@@ -47,5 +48,5 @@ public interface ElementNamespaceInstanceProvider { * @return An new Element instance. * @throws ElementNamespaceInstanceProviderException Thrown when error happened in language. */ - Element createElementInstance(ElementLanguage elementLanguage,String tag) throws ElementNamespaceInstanceProviderException; + Element createElementInstance(X4OLanguageContext elementLanguage,String tag) throws ElementNamespaceInstanceProviderException; } diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguageModuleLoaderDummy.java b/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguageModuleLoaderDummy.java deleted file mode 100644 index 6060f36..0000000 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguageModuleLoaderDummy.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2004-2012, Willem Cazander - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.x4o.xml.impl; - -import java.util.logging.Logger; - -import org.x4o.xml.core.config.X4OLanguageLocal; -import org.x4o.xml.element.ElementLanguageModule; -import org.x4o.xml.element.ElementLanguageModuleLoader; - -/** - * ElementLanguageModuleLoaderDummy loads nothing. - * - * @author Willem Cazander - * @version 1.0 Aug 3, 2012 - */ -public class DefaultElementLanguageModuleLoaderDummy implements ElementLanguageModuleLoader { - - private Logger logger = null; - - /** - * Creates new DefaultElementLanguageModuleLoaderDummy. - */ - public DefaultElementLanguageModuleLoaderDummy() { - logger = Logger.getLogger(DefaultElementLanguageModuleLoaderDummy.class.getName()); - } - - /** - * @param elementLanguage The elementLanguage to load for. - * @param elementLanguageModule The elementLanguageModule to load for. - * @see org.x4o.xml.element.ElementLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.element.ElementLanguageModule) - */ - public void loadLanguageModule(X4OLanguageLocal elementLanguage,ElementLanguageModule elementLanguageModule) { - logger.fine("Dummy loader loads nothing."); - } -} diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/package-info.java b/x4o-core/src/main/java/org/x4o/xml/impl/package-info.java deleted file mode 100644 index 61a0409..0000000 --- a/x4o-core/src/main/java/org/x4o/xml/impl/package-info.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2004-2012, Willem Cazander - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * The X4O Element and language implementation.The X4O XML Element interfaces. - * - * - * @since 1.0 - */ - -package org.x4o.xml.impl; diff --git a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OConnection.java b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OConnection.java index 35df2c5..4434109 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OConnection.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OConnection.java @@ -23,18 +23,18 @@ package org.x4o.xml.io; -import org.x4o.xml.core.config.X4OLanguageProperty; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageProperty; public abstract class AbstractX4OConnection implements X4OConnection { - private ElementLanguage languageContext = null; + private X4OLanguageContext languageContext = null; - public AbstractX4OConnection(ElementLanguage languageContext) { + public AbstractX4OConnection(X4OLanguageContext languageContext) { this.languageContext=languageContext; } - protected ElementLanguage getLanguageContext() { + protected X4OLanguageContext getLanguageContext() { return languageContext; } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReader.java b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReader.java index 916a414..3e29e45 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReader.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReader.java @@ -31,8 +31,8 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; @@ -46,7 +46,7 @@ import javax.xml.parsers.ParserConfigurationException; */ abstract public class AbstractX4OReader extends AbstractX4OReaderContext implements X4OReader { - public AbstractX4OReader(ElementLanguage elementLanguage) { + public AbstractX4OReader(X4OLanguageContext elementLanguage) { super(elementLanguage); } @@ -59,7 +59,7 @@ abstract public class AbstractX4OReader extends AbstractX4OReaderContext i @SuppressWarnings("unchecked") public T read(InputStream input, String systemId, URL basePath) throws ParserConfigurationException, SAXException, IOException { - ElementLanguage context = readContext(input, systemId, basePath); + X4OLanguageContext context = readContext(input, systemId, basePath); return (T)context.getRootElement().getElementObject(); } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java index d480c36..b5fc80c 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java @@ -31,7 +31,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; @@ -44,7 +44,7 @@ import javax.xml.parsers.ParserConfigurationException; */ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection implements X4OReaderContext { - public AbstractX4OReaderContext(ElementLanguage languageContext) { + public AbstractX4OReaderContext(X4OLanguageContext languageContext) { super(languageContext); } @@ -59,7 +59,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws IOException * @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL) */ - public ElementLanguage readFileContext(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { + public X4OLanguageContext readFileContext(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { if (fileName==null) { throw new NullPointerException("Can't convert null fileName to file object."); } @@ -77,7 +77,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws IOException * @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL) */ - public ElementLanguage readFileContext(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { + public X4OLanguageContext readFileContext(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { if (file==null) { throw new NullPointerException("Can't read null file."); } @@ -108,7 +108,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws SAXException * @throws IOException */ - public ElementLanguage readResourceContext(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { + public X4OLanguageContext readResourceContext(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { if (resourceName==null) { throw new NullPointerException("Can't read null resourceName from classpath."); } @@ -143,7 +143,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws NullPointerException * @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL) */ - public ElementLanguage readStringContext(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException { + public X4OLanguageContext readStringContext(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException { if (xmlString==null) { throw new NullPointerException("Can't read null xml string."); } @@ -160,7 +160,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws NullPointerException * @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL) */ - public ElementLanguage readUrlContext(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException { + public X4OLanguageContext readUrlContext(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException { if (url==null) { throw new NullPointerException("Can't read null url."); } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java index 7156fe1..9bcc45c 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java @@ -31,13 +31,13 @@ import java.io.OutputStream; import javax.xml.parsers.ParserConfigurationException; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.xml.sax.SAXException; public abstract class AbstractX4OWriter extends AbstractX4OWriterContext implements X4OWriter { - public AbstractX4OWriter(ElementLanguage elementLanguage) { + public AbstractX4OWriter(X4OLanguageContext elementLanguage) { super(elementLanguage); } @@ -49,7 +49,7 @@ public abstract class AbstractX4OWriter extends AbstractX4OWriterContext i } public void write(T object,OutputStream output) throws ParserConfigurationException, SAXException, IOException { - ElementLanguage context = getLanguageContext(); + X4OLanguageContext context = getLanguageContext(); context.getRootElement().setElementObject(object); //TODO: check ?? writeContext(context,output); } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java index d824e09..5a93f2e 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java @@ -31,23 +31,23 @@ import java.io.OutputStream; import javax.xml.parsers.ParserConfigurationException; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; import org.xml.sax.SAXException; public abstract class AbstractX4OWriterContext extends AbstractX4OConnection implements X4OWriterContext { - public AbstractX4OWriterContext(ElementLanguage elementLanguage) { + public AbstractX4OWriterContext(X4OLanguageContext elementLanguage) { super(elementLanguage); } - public void writeFileContext(ElementLanguage context,String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { + public void writeFileContext(X4OLanguageContext context,String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { if (fileName==null) { throw new NullPointerException("Can't convert null fileName to file object."); } writeFileContext(context,new File(fileName)); } - public void writeFileContext(ElementLanguage context,File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { + public void writeFileContext(X4OLanguageContext context,File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException { if (file==null) { throw new NullPointerException("Can't read null file."); } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4ODriver.java b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4ODriver.java index aa066c7..f94d481 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4ODriver.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4ODriver.java @@ -24,10 +24,10 @@ package org.x4o.xml.io; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.DefaultX4OLanguage; -import org.x4o.xml.core.config.DefaultX4OLanguageConfiguration; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.phase.X4OPhaseManagerFactory; +import org.x4o.xml.lang.DefaultX4OLanguage; +import org.x4o.xml.lang.DefaultX4OLanguageConfiguration; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.phase.X4OPhaseManagerFactory; public class DefaultX4ODriver extends X4ODriver { diff --git a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OReader.java b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OReader.java index b88a31b..6908c6a 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OReader.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OReader.java @@ -35,14 +35,14 @@ import java.util.logging.Logger; import javax.xml.parsers.ParserConfigurationException; -import org.x4o.xml.core.X4ODebugWriter; -import org.x4o.xml.core.config.X4OLanguageProperty; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.core.phase.X4OPhaseException; -import org.x4o.xml.core.phase.X4OPhaseType; -import org.x4o.xml.element.ElementLanguage; -import org.x4o.xml.element.ElementLanguageLocal; +import org.x4o.xml.io.sax.X4ODebugWriter; import org.x4o.xml.io.sax.XMLWriter; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageContextLocal; +import org.x4o.xml.lang.X4OLanguageProperty; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; +import org.x4o.xml.lang.phase.X4OPhaseException; +import org.x4o.xml.lang.phase.X4OPhaseType; import org.xml.sax.SAXException; import org.xml.sax.ext.DefaultHandler2; import org.xml.sax.helpers.AttributesImpl; @@ -59,12 +59,12 @@ public class DefaultX4OReader extends AbstractX4OReader { /** The logger to log to. */ private Logger logger = null; - public DefaultX4OReader(ElementLanguage elementLanguage) { + public DefaultX4OReader(X4OLanguageContext elementLanguage) { super(elementLanguage); logger = Logger.getLogger(DefaultX4OReader.class.getName()); } - public ElementLanguage readContext(InputStream input, String systemId, URL basePath) throws ParserConfigurationException, SAXException, IOException { + public X4OLanguageContext readContext(InputStream input, String systemId, URL basePath) throws ParserConfigurationException, SAXException, IOException { setProperty(X4OLanguagePropertyKeys.INPUT_SOURCE_STREAM, input); setProperty(X4OLanguagePropertyKeys.INPUT_SOURCE_SYSTEM_ID, systemId); setProperty(X4OLanguagePropertyKeys.INPUT_SOURCE_BASE_PATH, basePath); @@ -96,7 +96,7 @@ public class DefaultX4OReader extends AbstractX4OReader { * Parses the input stream as a X4O document. */ protected void read() throws ParserConfigurationException,SAXException,IOException { - ElementLanguage elementLanguage = getLanguageContext(); + X4OLanguageContext elementLanguage = getLanguageContext(); if (elementLanguage.getLanguage()==null) { throw new ParserConfigurationException("parserConfig is broken getLanguage() returns null."); } @@ -116,7 +116,7 @@ public class DefaultX4OReader extends AbstractX4OReader { xmlDebugWriter.startDocument(); xmlDebugWriter.startPrefixMapping("debug", X4ODebugWriter.DEBUG_URI); X4ODebugWriter debugWriter = new X4ODebugWriter(xmlDebugWriter); - ElementLanguageLocal local = (ElementLanguageLocal)elementLanguage; + X4OLanguageContextLocal local = (X4OLanguageContextLocal)elementLanguage; local.setX4ODebugWriter(debugWriter); startedDebugWriter = true; } @@ -195,7 +195,7 @@ public class DefaultX4OReader extends AbstractX4OReader { } } - public void releaseContext(ElementLanguage context) throws X4OPhaseException { + public void releaseContext(X4OLanguageContext context) throws X4OPhaseException { if (context==null) { return; } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OSchemaWriter.java b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OSchemaWriter.java index e0772a9..493a212 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OSchemaWriter.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OSchemaWriter.java @@ -25,14 +25,14 @@ package org.x4o.xml.io; import java.io.File; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import org.x4o.xml.eld.xsd.EldXsdXmlGenerator; import org.x4o.xml.element.ElementException; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; public class DefaultX4OSchemaWriter extends AbstractX4OConnection implements X4OSchemaWriter { - public DefaultX4OSchemaWriter(ElementLanguage languageContext) { + public DefaultX4OSchemaWriter(X4OLanguageContext languageContext) { super(languageContext); } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java index 7a6633d..37da7e4 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java @@ -29,16 +29,16 @@ import java.io.OutputStream; import javax.xml.parsers.ParserConfigurationException; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; import org.xml.sax.SAXException; public class DefaultX4OWriter extends AbstractX4OWriter { - public DefaultX4OWriter(ElementLanguage elementLanguage) { + public DefaultX4OWriter(X4OLanguageContext elementLanguage) { super(elementLanguage); } - public void writeContext(ElementLanguage context,OutputStream out) throws ParserConfigurationException, + public void writeContext(X4OLanguageContext context,OutputStream out) throws ParserConfigurationException, FileNotFoundException, SecurityException, NullPointerException, SAXException, IOException { diff --git a/x4o-core/src/main/java/org/x4o/xml/io/X4OReaderContext.java b/x4o-core/src/main/java/org/x4o/xml/io/X4OReaderContext.java index fad5b3c..45b3c0c 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/X4OReaderContext.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/X4OReaderContext.java @@ -31,13 +31,13 @@ import java.net.URL; import javax.xml.parsers.ParserConfigurationException; -import org.x4o.xml.core.phase.X4OPhaseException; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.phase.X4OPhaseException; import org.xml.sax.SAXException; public interface X4OReaderContext extends X4OReader { - void releaseContext(ElementLanguage context) throws X4OPhaseException; + void releaseContext(X4OLanguageContext context) throws X4OPhaseException; /** * Method to parse the xml data. @@ -46,7 +46,7 @@ public interface X4OReaderContext extends X4OReader { * @throws SAXException * @throws IOException */ - ElementLanguage readContext(InputStream input,String systemId,URL basePath) throws ParserConfigurationException,SAXException,IOException; + X4OLanguageContext readContext(InputStream input,String systemId,URL basePath) throws ParserConfigurationException,SAXException,IOException; /** * Reads the file fileName and parses it as an InputStream. @@ -59,7 +59,7 @@ public interface X4OReaderContext extends X4OReader { * @throws IOException * @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL) */ - ElementLanguage readFileContext(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; + X4OLanguageContext readFileContext(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; /** * Reads the file and parses it as an InputStream. @@ -72,7 +72,7 @@ public interface X4OReaderContext extends X4OReader { * @throws IOException * @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL) */ - ElementLanguage readFileContext(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; + X4OLanguageContext readFileContext(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; /** * Parses an resource locaction. @@ -84,7 +84,7 @@ public interface X4OReaderContext extends X4OReader { * @throws SAXException * @throws IOException */ - ElementLanguage readResourceContext(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; + X4OLanguageContext readResourceContext(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; /** * Converts a String to a InputStream to is can me parsed by SAX. @@ -95,7 +95,7 @@ public interface X4OReaderContext extends X4OReader { * @throws NullPointerException * @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL) */ - ElementLanguage readStringContext(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException; + X4OLanguageContext readStringContext(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException; /** * Fetched the data direct from remote url to a InputStream to is can me parsed by SAX. @@ -106,5 +106,5 @@ public interface X4OReaderContext extends X4OReader { * @throws NullPointerException * @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL) */ - ElementLanguage readUrlContext(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException; + X4OLanguageContext readUrlContext(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException; } diff --git a/x4o-core/src/main/java/org/x4o/xml/io/X4OWriterContext.java b/x4o-core/src/main/java/org/x4o/xml/io/X4OWriterContext.java index e0b9d7b..73c65bf 100644 --- a/x4o-core/src/main/java/org/x4o/xml/io/X4OWriterContext.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/X4OWriterContext.java @@ -30,14 +30,14 @@ import java.io.OutputStream; import javax.xml.parsers.ParserConfigurationException; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; import org.xml.sax.SAXException; public interface X4OWriterContext extends X4OWriter { - void writeContext(ElementLanguage context,OutputStream out) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; + void writeContext(X4OLanguageContext context,OutputStream out) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; - void writeFileContext(ElementLanguage context,String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; + void writeFileContext(X4OLanguageContext context,String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; - void writeFileContext(ElementLanguage context,File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; + void writeFileContext(X4OLanguageContext context,File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException; } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/X4ODebugWriter.java b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/core/X4ODebugWriter.java rename to x4o-core/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java index 3fccf5f..6a03367 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/X4ODebugWriter.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4ODebugWriter.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core; +package org.x4o.xml.io.sax; import java.lang.reflect.Method; import java.util.Collection; @@ -29,11 +29,6 @@ import java.util.List; import java.util.Map; import org.x4o.xml.conv.ObjectConverter; -import org.x4o.xml.core.config.X4OLanguageConfiguration; -import org.x4o.xml.core.config.X4OLanguageProperty; -import org.x4o.xml.core.phase.X4OPhaseException; -import org.x4o.xml.core.phase.X4OPhase; -import org.x4o.xml.core.phase.X4OPhaseListener; import org.x4o.xml.element.Element; import org.x4o.xml.element.ElementAttributeHandler; import org.x4o.xml.element.ElementBindingHandler; @@ -42,12 +37,17 @@ import org.x4o.xml.element.ElementClassAttribute; import org.x4o.xml.element.ElementClassBase; import org.x4o.xml.element.ElementConfigurator; import org.x4o.xml.element.ElementConfiguratorGlobal; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementException; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; import org.x4o.xml.element.ElementNamespaceInstanceProvider; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageConfiguration; +import org.x4o.xml.lang.X4OLanguageProperty; +import org.x4o.xml.lang.phase.X4OPhase; +import org.x4o.xml.lang.phase.X4OPhaseException; +import org.x4o.xml.lang.phase.X4OPhaseListener; import org.xml.sax.SAXException; import org.xml.sax.ext.DefaultHandler2; import org.xml.sax.helpers.AttributesImpl; @@ -83,9 +83,9 @@ public class X4ODebugWriter { /** * @throws X4OPhaseException - * @see org.x4o.xml.core.phase.X4OPhaseListener#preRunPhase(org.x4o.xml.element.ElementLanguage) + * @see org.x4o.xml.lang.phase.X4OPhaseListener#preRunPhase(org.x4o.xml.lang.X4OLanguageContext) */ - public void preRunPhase(X4OPhase phase,ElementLanguage elementLanguage) throws X4OPhaseException { + public void preRunPhase(X4OPhase phase,X4OLanguageContext elementLanguage) throws X4OPhaseException { startTime = System.currentTimeMillis(); try { AttributesImpl atts = new AttributesImpl(); @@ -99,7 +99,7 @@ public class X4ODebugWriter { debugPhase(phase); } - public void endRunPhase(X4OPhase phase,ElementLanguage elementLanguage) throws X4OPhaseException { + public void endRunPhase(X4OPhase phase,X4OLanguageContext elementLanguage) throws X4OPhaseException { long stopTime = System.currentTimeMillis(); try { AttributesImpl atts = new AttributesImpl(); @@ -115,7 +115,7 @@ public class X4ODebugWriter { } } - public void debugLanguageProperties(ElementLanguage ec) throws ElementException { + public void debugLanguageProperties(X4OLanguageContext ec) throws ElementException { try { AttributesImpl atts = new AttributesImpl(); debugWriter.startElement (DEBUG_URI, "X4OLanguageProperties", "", atts); @@ -136,7 +136,7 @@ public class X4ODebugWriter { } } - public void debugLanguageDefaultClasses(ElementLanguage ec) throws ElementException { + public void debugLanguageDefaultClasses(X4OLanguageContext ec) throws ElementException { try { AttributesImpl atts = new AttributesImpl(); debugWriter.startElement (DEBUG_URI, "X4OLanguageDefaultClasses", "", atts); @@ -212,20 +212,20 @@ public class X4ODebugWriter { } } - public void debugElementLanguageModules(ElementLanguage elementLanguage) throws ElementException { + public void debugElementLanguageModules(X4OLanguageContext elementLanguage) throws ElementException { try { AttributesImpl attsEmpty = new AttributesImpl(); debugWriter.startElement (DEBUG_URI, "ElementLanguageModules", "", attsEmpty); - for (ElementLanguageModule module:elementLanguage.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule module:elementLanguage.getLanguage().getLanguageModules()) { AttributesImpl atts = new AttributesImpl(); atts.addAttribute ("", "className", "", "", module.getClass().getName()); atts.addAttribute ("", "name", "", "", module.getName()); atts.addAttribute ("", "providerName", "", "", module.getProviderName()); - if (module.getElementLanguageModuleLoader()==null) { + if (module.getLanguageModuleLoader()==null) { atts.addAttribute ("", "elementLanguageModuleLoaderClassName", "", "", "null"); } else { - atts.addAttribute ("", "elementLanguageModuleLoaderClassName", "", "", module.getElementLanguageModuleLoader().getClass().getName()); + atts.addAttribute ("", "elementLanguageModuleLoaderClassName", "", "", module.getLanguageModuleLoader().getClass().getName()); } debugWriter.startElement (DEBUG_URI, "ElementLanguageModule", "", atts); @@ -422,7 +422,7 @@ public class X4ODebugWriter { } } - public void debugElementLanguage(ElementLanguage elementLanguage) throws SAXException { + public void debugElementLanguage(X4OLanguageContext elementLanguage) throws SAXException { AttributesImpl atts = new AttributesImpl(); //atts.addAttribute ("", key, "", "", value); atts.addAttribute ("", "language", "", "", elementLanguage.getLanguage().getLanguageName()); diff --git a/x4o-core/src/main/java/org/x4o/xml/core/X4OEntityResolver.java b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4OEntityResolver.java similarity index 93% rename from x4o-core/src/main/java/org/x4o/xml/core/X4OEntityResolver.java rename to x4o-core/src/main/java/org/x4o/xml/io/sax/X4OEntityResolver.java index 6139230..c19dc86 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/X4OEntityResolver.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4OEntityResolver.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core; +package org.x4o.xml.io.sax; import java.io.File; import java.io.FileInputStream; @@ -31,11 +31,11 @@ import java.util.HashMap; import java.util.Map; import java.util.logging.Logger; -import org.x4o.xml.core.config.X4OLanguageClassLoader; -import org.x4o.xml.core.config.X4OLanguageProperty; -import org.x4o.xml.element.ElementLanguage; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageProperty; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -56,7 +56,7 @@ public class X4OEntityResolver implements EntityResolver { private Logger logger = null; private URL basePath = null; - private ElementLanguage elementContext = null; + private X4OLanguageContext elementContext = null; private Map schemaResources = null; private Map schemaPathResources = null; @@ -64,7 +64,7 @@ public class X4OEntityResolver implements EntityResolver { * Creates an X4OEntityResolver for a language. * @param elementContext The x4o language to resolve entities for. */ - public X4OEntityResolver(ElementLanguage elementContext) { + public X4OEntityResolver(X4OLanguageContext elementContext) { if (elementContext==null) { throw new NullPointerException("Can't provide entities with null elementContext."); } @@ -73,7 +73,7 @@ public class X4OEntityResolver implements EntityResolver { this.basePath=(URL)elementContext.getLanguageProperty(X4OLanguageProperty.INPUT_SOURCE_BASE_PATH); this.schemaResources=new HashMap(20); this.schemaPathResources=new HashMap(20); - for (ElementLanguageModule mod:elementContext.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:elementContext.getLanguage().getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { if (ns.getSchemaUri()==null) { continue; diff --git a/x4o-core/src/main/java/org/x4o/xml/core/X4OErrorHandler.java b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4OErrorHandler.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/core/X4OErrorHandler.java rename to x4o-core/src/main/java/org/x4o/xml/io/sax/X4OErrorHandler.java index 55b83dc..0278fd0 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/X4OErrorHandler.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4OErrorHandler.java @@ -21,11 +21,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core; +package org.x4o.xml.io.sax; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.element.ElementException; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageProperty; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; @@ -38,14 +38,14 @@ import org.xml.sax.SAXParseException; */ public class X4OErrorHandler implements ErrorHandler { - private ElementLanguage elementContext = null; + private X4OLanguageContext elementContext = null; private ErrorHandler errorHandler = null; /** * Construct a new SAXErrorPrinter * @param language The language to get errors to. */ - public X4OErrorHandler(ElementLanguage elementContext) { + public X4OErrorHandler(X4OLanguageContext elementContext) { if (elementContext==null) { throw new NullPointerException("Can't debug and proxy errors with null elementContext."); } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/X4OTagHandler.java b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4OTagHandler.java similarity index 97% rename from x4o-core/src/main/java/org/x4o/xml/core/X4OTagHandler.java rename to x4o-core/src/main/java/org/x4o/xml/io/sax/X4OTagHandler.java index c4298fb..60587b1 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/X4OTagHandler.java +++ b/x4o-core/src/main/java/org/x4o/xml/io/sax/X4OTagHandler.java @@ -21,16 +21,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core; +package org.x4o.xml.io.sax; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.element.Element; import org.x4o.xml.element.Element.ElementType; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementException; import org.x4o.xml.element.ElementNamespaceContext; import org.x4o.xml.element.ElementNamespaceInstanceProvider; -import org.x4o.xml.io.sax.AttributeMap; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageProperty; import org.xml.sax.Attributes; import org.xml.sax.Locator; import org.xml.sax.SAXException; @@ -61,7 +60,7 @@ public class X4OTagHandler extends DefaultHandler2 { private Stack elementStack = null; /** The elememtContext */ - private ElementLanguage elementLanguage = null; + private X4OLanguageContext elementLanguage = null; /** Store the override element */ private Element overrideSaxElement = null; @@ -73,7 +72,7 @@ public class X4OTagHandler extends DefaultHandler2 { * Creates an X4OTagHandler * which can receice sax xml events and converts them into the Element* interfaces events. */ - public X4OTagHandler(ElementLanguage elementLanguage) { + public X4OTagHandler(X4OLanguageContext elementLanguage) { logger = Logger.getLogger(X4OTagHandler.class.getName()); loggerFinest = logger.isLoggable(Level.FINEST); elementStack = new Stack(); diff --git a/x4o-core/src/main/java/org/x4o/xml/element/AbstractElementLanguage.java b/x4o-core/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageContext.java similarity index 75% rename from x4o-core/src/main/java/org/x4o/xml/element/AbstractElementLanguage.java rename to x4o-core/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageContext.java index 5f2c136..d53fe3e 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/AbstractElementLanguage.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageContext.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; import java.util.Map; import java.util.HashMap; @@ -30,10 +30,11 @@ import java.util.logging.Logger; import javax.el.ELContext; import javax.el.ExpressionFactory; -import org.x4o.xml.core.X4ODebugWriter; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguageProperty; -import org.x4o.xml.core.phase.X4OPhase; +import org.x4o.xml.element.Element; +import org.x4o.xml.element.ElementAttributeValueParser; +import org.x4o.xml.element.ElementObjectPropertyValue; +import org.x4o.xml.io.sax.X4ODebugWriter; +import org.x4o.xml.lang.phase.X4OPhase; /** * An AbstractElementLanguage. @@ -41,7 +42,7 @@ import org.x4o.xml.core.phase.X4OPhase; * @author Willem Cazander * @version 1.0 Aug 20, 2005 */ -public abstract class AbstractElementLanguage implements ElementLanguageLocal { +public abstract class AbstractX4OLanguageContext implements X4OLanguageContextLocal { private Logger logger = null; private X4OLanguage language = null; @@ -58,7 +59,7 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { /** * Creates a new empty ElementLanguage. */ - public AbstractElementLanguage(X4OLanguage language,String languageVersion) { + public AbstractX4OLanguageContext(X4OLanguage language,String languageVersion) { if (language==null) { throw new NullPointerException("language may not be null"); } @@ -68,7 +69,7 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { if (languageVersion.length()==0) { throw new IllegalArgumentException("languageVersion may not be empty"); } - logger = Logger.getLogger(AbstractElementLanguage.class.getName()); + logger = Logger.getLogger(AbstractX4OLanguageContext.class.getName()); logger.finest("Creating new ParsingContext"); this.language=language; dirtyElements = new HashMap(40); @@ -82,16 +83,16 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.element.ElementLanguage#getELContext() + * @see org.x4o.xml.lang.X4OLanguageContext#getExpressionLanguageContext() */ - public ELContext getELContext() { + public ELContext getExpressionLanguageContext() { return eLContext; } /** - * @see org.x4o.xml.element.ElementLanguageLocal#setELContext(javax.el.ELContext) + * @see org.x4o.xml.lang.X4OLanguageContextLocal#setExpressionLanguageContext(javax.el.ELContext) */ - public void setELContext(ELContext context) { + public void setExpressionLanguageContext(ELContext context) { if (eLContext!=null) { throw new IllegalStateException("Can only set elContext once."); } @@ -99,16 +100,16 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.element.ElementLanguage#getExpressionFactory() + * @see org.x4o.xml.lang.X4OLanguageContext#getExpressionLanguageFactory() */ - public ExpressionFactory getExpressionFactory() { + public ExpressionFactory getExpressionLanguageFactory() { return expressionFactory; } /** - * @see org.x4o.xml.element.ElementLanguageLocal#setExpressionFactory(javax.el.ExpressionFactory) + * @see org.x4o.xml.lang.X4OLanguageContextLocal#setExpressionLanguageFactory(javax.el.ExpressionFactory) */ - public void setExpressionFactory(ExpressionFactory expressionFactory) { + public void setExpressionLanguageFactory(ExpressionFactory expressionFactory) { if (this.expressionFactory!=null) { throw new IllegalStateException("Can only set expressionFactory once."); } @@ -150,21 +151,21 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.element.ElementLanguage#getCurrentX4OPhase() + * @see org.x4o.xml.lang.X4OLanguageContext#getCurrentX4OPhase() */ public X4OPhase getCurrentX4OPhase() { return currentX4OPhase; } /** - * @see org.x4o.xml.element.ElementLanguage#setCurrentX4OPhase(org.x4o.xml.core.phase.X4OPhase) + * @see org.x4o.xml.lang.X4OLanguageContext#setCurrentX4OPhase(org.x4o.xml.lang.phase.X4OPhase) */ public void setCurrentX4OPhase(X4OPhase currentX4OPhase) { this.currentX4OPhase = currentX4OPhase; } /** - * @see org.x4o.xml.element.ElementLanguage#addDirtyElement(org.x4o.xml.element.Element, org.x4o.xml.core.phase.X4OPhase) + * @see org.x4o.xml.lang.X4OLanguageContext#addDirtyElement(org.x4o.xml.element.Element, org.x4o.xml.lang.phase.X4OPhase) */ public void addDirtyElement(Element element, X4OPhase phase) { if (dirtyElements.containsKey(element)) { @@ -174,21 +175,21 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.element.ElementLanguage#getDirtyElements() + * @see org.x4o.xml.lang.X4OLanguageContext#getDirtyElements() */ public Map getDirtyElements() { return dirtyElements; } /** - * @see org.x4o.xml.element.ElementLanguage#getRootElement() + * @see org.x4o.xml.lang.X4OLanguageContext#getRootElement() */ public Element getRootElement() { return rootElement; } /** - * @see org.x4o.xml.element.ElementLanguage#setRootElement(org.x4o.xml.element.Element) + * @see org.x4o.xml.lang.X4OLanguageContext#setRootElement(org.x4o.xml.element.Element) */ public void setRootElement(Element element) { if (element==null) { @@ -210,14 +211,14 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getLanguageProperty(org.x4o.xml.core.config.X4OLanguageProperty) + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getLanguageProperty(org.x4o.xml.lang.X4OLanguageProperty) */ public Object getLanguageProperty(X4OLanguageProperty property) { return getLanguageProperty(property.toUri()); } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#setLanguageProperty(org.x4o.xml.core.config.X4OLanguageProperty, java.lang.Object) + * @see org.x4o.xml.lang.X4OLanguageConfiguration#setLanguageProperty(org.x4o.xml.lang.X4OLanguageProperty, java.lang.Object) */ public void setLanguageProperty(X4OLanguageProperty property, Object value) { if (property.isValueValid(value)==false) { @@ -227,7 +228,7 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getLanguagePropertyBoolean(org.x4o.xml.core.config.X4OLanguageProperty) + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getLanguagePropertyBoolean(org.x4o.xml.lang.X4OLanguageProperty) */ public boolean getLanguagePropertyBoolean(X4OLanguageProperty property) { Object value = getLanguageProperty(property); @@ -238,7 +239,7 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getLanguagePropertyInteger(org.x4o.xml.core.config.X4OLanguageProperty) + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getLanguagePropertyInteger(org.x4o.xml.lang.X4OLanguageProperty) */ public int getLanguagePropertyInteger(X4OLanguageProperty property) { Object value = getLanguageProperty(property); @@ -257,21 +258,21 @@ public abstract class AbstractElementLanguage implements ElementLanguageLocal { } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getX4ODebugWriter() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getX4ODebugWriter() */ public X4ODebugWriter getX4ODebugWriter() { return debugWriter; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#hasX4ODebugWriter() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#hasX4ODebugWriter() */ public boolean hasX4ODebugWriter() { return debugWriter!=null; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#setX4ODebugWriter(org.x4o.xml.core.X4ODebugWriter) + * @see org.x4o.xml.lang.X4OLanguageConfiguration#setX4ODebugWriter(org.x4o.xml.io.sax.X4ODebugWriter) */ public void setX4ODebugWriter(X4ODebugWriter debugWriter) { this.debugWriter=debugWriter; diff --git a/x4o-core/src/main/java/org/x4o/xml/element/AbstractElementLanguageModule.java b/x4o-core/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java similarity index 80% rename from x4o-core/src/main/java/org/x4o/xml/element/AbstractElementLanguageModule.java rename to x4o-core/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java index fba4305..5116f60 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/AbstractElementLanguageModule.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/AbstractX4OLanguageModule.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; import java.util.List; import java.util.Map; @@ -29,7 +29,12 @@ import java.util.HashMap; import java.util.ArrayList; import java.util.logging.Logger; -import org.x4o.xml.core.config.X4OLanguageLocal; +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; +import org.x4o.xml.element.ElementNamespaceContext; /** * An AbstractElementLanguageModule. @@ -37,7 +42,7 @@ import org.x4o.xml.core.config.X4OLanguageLocal; * @author Willem Cazander * @version 1.0 Aug 2, 2012 */ -public abstract class AbstractElementLanguageModule extends AbstractElementMetaBase implements ElementLanguageModule { +public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase implements X4OLanguageModule { private Logger logger = null; @@ -57,13 +62,13 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB private Map elementNamespaceContexts = null; - private ElementLanguageModuleLoader elementLanguageModuleLoader = null; + private X4OLanguageModuleLoader elementLanguageModuleLoader = null; /** * Creates a new empty ElementLanguage. */ - public AbstractElementLanguageModule() { - logger = Logger.getLogger(AbstractElementLanguage.class.getName()); + public AbstractX4OLanguageModule() { + logger = Logger.getLogger(AbstractX4OLanguageContext.class.getName()); logger.finest("Creating new ParsingContext"); elementAttributeHandlers = new ArrayList(4); elementBindingHandlers = new ArrayList(4); @@ -101,7 +106,7 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB } /** - * @see org.x4o.xml.element.ElementLanguageModule#addElementAttributeHandler(ElementAttributeHandler) + * @see org.x4o.xml.lang.X4OLanguageModule#addElementAttributeHandler(ElementAttributeHandler) */ public void addElementAttributeHandler(ElementAttributeHandler elementAttributeHandler) { if (elementAttributeHandler==null) { @@ -115,14 +120,14 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB } /** - * @see org.x4o.xml.element.ElementLanguageModule#getElementAttributeHandlers() + * @see org.x4o.xml.lang.X4OLanguageModule#getElementAttributeHandlers() */ public List getElementAttributeHandlers() { return elementAttributeHandlers; } /** - * @see org.x4o.xml.element.ElementLanguageModule#addElementBindingHandler(ElementBindingHandler) + * @see org.x4o.xml.lang.X4OLanguageModule#addElementBindingHandler(ElementBindingHandler) */ public void addElementBindingHandler(ElementBindingHandler elementBindingHandler) { if (elementBindingHandler==null) { @@ -143,14 +148,14 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB } /** - * @see org.x4o.xml.element.ElementLanguageModule#getElementBindingHandlers() + * @see org.x4o.xml.lang.X4OLanguageModule#getElementBindingHandlers() */ public List getElementBindingHandlers() { return elementBindingHandlers; } /** - * @see org.x4o.xml.element.ElementLanguageModule#addElementConfiguratorGlobal(ElementConfiguratorGlobal) + * @see org.x4o.xml.lang.X4OLanguageModule#addElementConfiguratorGlobal(ElementConfiguratorGlobal) */ public void addElementConfiguratorGlobal(ElementConfiguratorGlobal elementConfigurator) { if (elementConfigurator==null) { @@ -164,14 +169,14 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB } /** - * @see org.x4o.xml.element.ElementLanguageModule#getElementConfiguratorGlobals() + * @see org.x4o.xml.lang.X4OLanguageModule#getElementConfiguratorGlobals() */ public List getElementConfiguratorGlobals() { return elementConfiguratorGlobals; } /** - * @see org.x4o.xml.element.ElementLanguageModule#addElementInterface(org.x4o.xml.element.ElementInterface) + * @see org.x4o.xml.lang.X4OLanguageModule#addElementInterface(org.x4o.xml.element.ElementInterface) */ public void addElementInterface(ElementInterface elementInterface) { if (elementInterface==null) { @@ -187,14 +192,14 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB } /** - * @see org.x4o.xml.element.ElementLanguageModule#getElementInterfaces() + * @see org.x4o.xml.lang.X4OLanguageModule#getElementInterfaces() */ public List getElementInterfaces() { return elementInterfaces; } /** - * @see org.x4o.xml.element.ElementLanguageModule#addElementNamespaceContext(org.x4o.xml.element.ElementNamespaceContext) + * @see org.x4o.xml.lang.X4OLanguageModule#addElementNamespaceContext(org.x4o.xml.element.ElementNamespaceContext) */ public void addElementNamespaceContext(ElementNamespaceContext elementNamespaceContext) { if (elementNamespaceContext==null) { @@ -222,14 +227,14 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB } /** - * @see org.x4o.xml.element.ElementLanguageModule#getElementNamespaceContext(java.lang.String) + * @see org.x4o.xml.lang.X4OLanguageModule#getElementNamespaceContext(java.lang.String) */ public ElementNamespaceContext getElementNamespaceContext(String namespaceUri) { return elementNamespaceContexts.get(namespaceUri); } /** - * @see org.x4o.xml.element.ElementLanguageModule#getElementNamespaceContexts() + * @see org.x4o.xml.lang.X4OLanguageModule#getElementNamespaceContexts() */ public List getElementNamespaceContexts() { return new ArrayList(elementNamespaceContexts.values()); @@ -238,14 +243,14 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB /** * @return the elementLanguageModuleLoader */ - public ElementLanguageModuleLoader getElementLanguageModuleLoader() { + public X4OLanguageModuleLoader getLanguageModuleLoader() { return elementLanguageModuleLoader; } /** * @param elementLanguageModuleLoader the elementLanguageModuleLoader to set */ - public void setElementLanguageModuleLoader(ElementLanguageModuleLoader elementLanguageModuleLoader) { + public void setLanguageModuleLoader(X4OLanguageModuleLoader elementLanguageModuleLoader) { this.elementLanguageModuleLoader = elementLanguageModuleLoader; } @@ -266,12 +271,12 @@ public abstract class AbstractElementLanguageModule extends AbstractElementMetaB /** * Reloads the module, experiment !! */ - public void reloadModule(X4OLanguageLocal elementLanguage,ElementLanguageModule elementLanguageModule) throws ElementLanguageModuleLoaderException { + public void reloadModule(X4OLanguageLocal elementLanguage,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException { elementAttributeHandlers.clear(); elementBindingHandlers.clear(); elementInterfaces.clear(); elementNamespaceContexts.clear(); - getElementLanguageModuleLoader().loadLanguageModule(elementLanguage, elementLanguageModule); + getLanguageModuleLoader().loadLanguageModule(elementLanguage, elementLanguageModule); } } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguage.java b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguage.java similarity index 78% rename from x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguage.java rename to x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguage.java index 7b992d7..b38ca99 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguage.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguage.java @@ -1,27 +1,26 @@ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; -import org.x4o.xml.core.phase.X4OPhaseManager; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.lang.phase.X4OPhaseManager; public class DefaultX4OLanguage implements X4OLanguageLocal { private Logger logger = null; private X4OLanguageConfiguration languageConfiguration = null; - private List elementLanguageModules = null; + private List elementLanguageModules = null; private String languageName = null; private String languageVersion = null; private X4OPhaseManager phaseManager = null; public DefaultX4OLanguage(X4OLanguageConfiguration languageConfiguration,X4OPhaseManager phaseManager,String languageName,String languageVersion) { logger = Logger.getLogger(DefaultX4OLanguage.class.getName()); - elementLanguageModules = new ArrayList(20); + elementLanguageModules = new ArrayList(20); this.languageConfiguration=languageConfiguration; this.languageName=languageName; this.languageVersion=languageVersion; @@ -29,21 +28,21 @@ public class DefaultX4OLanguage implements X4OLanguageLocal { } /** - * @see org.x4o.xml.core.config.X4OLanguage#getLanguageName() + * @see org.x4o.xml.lang.X4OLanguage#getLanguageName() */ public String getLanguageName() { return languageName; } /** - * @see org.x4o.xml.core.config.X4OLanguage#getLanguageVersion() + * @see org.x4o.xml.lang.X4OLanguage#getLanguageVersion() */ public String getLanguageVersion() { return languageVersion; } /** - * @see org.x4o.xml.core.config.X4OLanguage#getPhaseManager() + * @see org.x4o.xml.lang.X4OLanguage#getPhaseManager() */ public X4OPhaseManager getPhaseManager() { return phaseManager; @@ -64,9 +63,9 @@ public class DefaultX4OLanguage implements X4OLanguageLocal { }*/ /** - * @see org.x4o.xml.element.ElementLanguage#addElementLanguageModule(org.x4o.xml.element.ElementLanguageModule) + * @see org.x4o.xml.lang.X4OLanguageContext#addLanguageModule(org.x4o.xml.lang.X4OLanguageModule) */ - public void addElementLanguageModule(ElementLanguageModule elementLanguageModule) { + public void addLanguageModule(X4OLanguageModule elementLanguageModule) { if (elementLanguageModule.getId()==null) { throw new NullPointerException("Can't add module without id."); } @@ -74,20 +73,20 @@ public class DefaultX4OLanguage implements X4OLanguageLocal { } /** - * @see org.x4o.xml.element.ElementLanguage#getElementLanguageModules() + * @see org.x4o.xml.lang.X4OLanguageContext#getLanguageModules() */ - public List getElementLanguageModules() { + public List getLanguageModules() { return elementLanguageModules; } /** - * @see org.x4o.xml.element.ElementLanguage#findElementBindingHandlers(java.lang.Object,java.lang.Object) + * @see org.x4o.xml.lang.X4OLanguageContext#findElementBindingHandlers(java.lang.Object,java.lang.Object) */ public List findElementBindingHandlers(Object parent,Object child) { List result = new ArrayList(50); for (int i=0;i findElementInterfaces(Object elementObject) { if (elementObject==null) { @@ -132,7 +131,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal { } List result = new ArrayList(50); for (int i=0;i eClass = ei.getInterfaceClass(); logger.finest("Checking interface handler: "+ei+" for class: "+eClass); @@ -149,14 +148,14 @@ public class DefaultX4OLanguage implements X4OLanguageLocal { } /** - * @see org.x4o.xml.element.ElementLanguage#findElementNamespaceContext(java.lang.String) + * @see org.x4o.xml.lang.X4OLanguageContext#findElementNamespaceContext(java.lang.String) */ public ElementNamespaceContext findElementNamespaceContext(String namespaceUri) { // TODO: refactor so no search for every tag !! ElementNamespaceContext result = null; for (int i=0;i getDefaultElementNamespaceContext() { return DefaultElementNamespaceContext.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementInterface() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementInterface() */ public Class getDefaultElementInterface() { return DefaultElementInterface.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElement() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElement() */ public Class getDefaultElement() { return DefaultElement.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementClass() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementClass() */ public Class getDefaultElementClass() { return DefaultElementClass.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementClassAttribute() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementClassAttribute() */ public Class getDefaultElementClassAttribute() { return DefaultElementClassAttribute.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementLanguageModule() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementLanguageModule() */ public Class getDefaultElementLanguageModule() { - return DefaultElementLanguageModule.class; + return DefaultX4OLanguageModule.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementBodyComment() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementBodyComment() */ public Class getDefaultElementBodyComment() { return DefaultElementBodyComment.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementBodyCharacters() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementBodyCharacters() */ public Class getDefaultElementBodyCharacters() { return DefaultElementBodyCharacters.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementBodyWhitespace() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementBodyWhitespace() */ public Class getDefaultElementBodyWhitespace() { return DefaultElementBodyWhitespace.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementNamespaceInstanceProvider() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementNamespaceInstanceProvider() */ public Class getDefaultElementNamespaceInstanceProvider() { return DefaultElementNamespaceInstanceProvider.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementAttributeValueParser() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementAttributeValueParser() */ public Class getDefaultElementAttributeValueParser() { return DefaultElementAttributeValueParser.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementObjectPropertyValue() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementObjectPropertyValue() */ public Class getDefaultElementObjectPropertyValue() { return DefaultElementObjectPropertyValue.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultElementAttributeHandlerComparator() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultElementAttributeHandlerComparator() */ public Class getDefaultElementAttributeHandlerComparator() { return DefaultGlobalAttributeHandlerComparator.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultX4OLanguageVersionFilter() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultX4OLanguageVersionFilter() */ public Class getDefaultX4OLanguageVersionFilter() { return DefaultX4OLanguageVersionFilter.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getDefaultX4OLanguageLoader() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultX4OLanguageLoader() */ public Class getDefaultX4OLanguageLoader() { return DefaultX4OLanguageLoader.class; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#createElementLanguage() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#createElementLanguage() */ - public ElementLanguage createElementLanguage(X4ODriver driver) { - String v = driver.DEFAULT_LANGUAGE_VERSION; // TODO:fixme - return configElementLanguage(new DefaultElementLanguage(driver.createLanguage(v),v),driver); + public X4OLanguageContext createElementLanguage(X4ODriver driver) { + String v = X4ODriver.DEFAULT_LANGUAGE_VERSION; // TODO:fixme + return configElementLanguage(new DefaultX4OLanguageContext(driver.createLanguage(v),v),driver); } - protected ElementLanguage configElementLanguage(ElementLanguage elementLanguage,X4ODriver driver) { - if ((elementLanguage instanceof ElementLanguageLocal)==false) { + protected X4OLanguageContext configElementLanguage(X4OLanguageContext elementLanguage,X4ODriver driver) { + if ((elementLanguage instanceof X4OLanguageContextLocal)==false) { throw new RuntimeException("Can't init ElementLanguage which has not ElementLanguageLocal interface obj: "+elementLanguage); } - ElementLanguageLocal contextInit = (ElementLanguageLocal)elementLanguage; + X4OLanguageContextLocal contextInit = (X4OLanguageContextLocal)elementLanguage; //contextInit.setLanguageConfiguration(this); for (String key:driver.getGlobalPropertyKeys()) { Object value = driver.getGlobalProperty(key); contextInit.setLanguageProperty(key, value); } - if (contextInit.getExpressionFactory()==null) { - contextInit.setExpressionFactory(configExpressionFactory(contextInit)); + if (contextInit.getExpressionLanguageFactory()==null) { + contextInit.setExpressionLanguageFactory(configExpressionFactory(contextInit)); } - if (contextInit.getELContext()==null) { - contextInit.setELContext(new X4OELContext()); + if (contextInit.getExpressionLanguageContext()==null) { + contextInit.setExpressionLanguageContext(new X4OELContext()); } try { if (contextInit.getElementAttributeValueParser()==null) { @@ -221,7 +217,7 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration return elementLanguage; } - protected ExpressionFactory configExpressionFactory(ElementLanguage elementContext) { + protected ExpressionFactory configExpressionFactory(X4OLanguageContext elementContext) { ExpressionFactory factory = (ExpressionFactory)elementContext.getLanguageProperty(X4OLanguageProperty.EL_FACTORY_INSTANCE); if (factory!=null) { return factory; @@ -242,26 +238,26 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getSAXParserProperties() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserProperties() */ - public Map getSAXParserProperties(ElementLanguage elementContext) { + public Map getSAXParserProperties(X4OLanguageContext elementContext) { Map saxParserProperties = new HashMap(1); return saxParserProperties; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getSAXParserPropertiesOptional() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserPropertiesOptional() */ - public Map getSAXParserPropertiesOptional(ElementLanguage elementContext) { + public Map getSAXParserPropertiesOptional(X4OLanguageContext elementContext) { Map saxParserProperties = new HashMap(1); saxParserProperties.put("http://apache.org/xml/properties/input-buffer-size",elementContext.getLanguagePropertyInteger(X4OLanguageProperty.INPUT_BUFFER_SIZE)); // Increase buffer to 8KB return saxParserProperties; } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getSAXParserFeatures() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeatures() */ - public Map getSAXParserFeatures(ElementLanguage elementContext) { + public Map getSAXParserFeatures(X4OLanguageContext elementContext) { // see example: http://xerces.apache.org/xerces2-j/features.html Map saxParserFeatures = new HashMap(20); @@ -308,9 +304,9 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getSAXParserFeaturesOptional() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeaturesOptional() */ - public Map getSAXParserFeaturesOptional(ElementLanguage elementContext) { + public Map getSAXParserFeaturesOptional(X4OLanguageContext elementContext) { Map saxParserFeatures = new HashMap(20); // Make Sax Impl more strict. @@ -332,9 +328,9 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration } /** - * @see org.x4o.xml.core.config.X4OLanguageConfiguration#getSAXParserFeaturesRequired() + * @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeaturesRequired() */ - public List getSAXParserFeaturesRequired(ElementLanguage elementContext) { + public List getSAXParserFeaturesRequired(X4OLanguageContext elementContext) { List result = new ArrayList(5); result.add("http://xml.org/sax/features/use-attributes2"); // Attributes objects passed by the parser are ext.Attributes2 interface. result.add("http://xml.org/sax/features/use-locator2"); // Locator objects passed by the parser are org.xml.sax.ext.Locator2 interface. diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguage.java b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageContext.java similarity index 84% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguage.java rename to x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageContext.java index 660d8b9..75bfa0e 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguage.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageContext.java @@ -21,10 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.lang; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.element.AbstractElementLanguage; /** * An DefaultElementLanguage. @@ -32,9 +30,9 @@ import org.x4o.xml.element.AbstractElementLanguage; * @author Willem Cazander * @version 1.0 Feb 16, 2007 */ -public class DefaultElementLanguage extends AbstractElementLanguage { +public class DefaultX4OLanguageContext extends AbstractX4OLanguageContext { - public DefaultElementLanguage(X4OLanguage language, String languageVersion) { + public DefaultX4OLanguageContext(X4OLanguage language, String languageVersion) { super(language, languageVersion); } } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguageLoader.java b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java similarity index 88% rename from x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguageLoader.java rename to x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java index 897a3eb..0568be0 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguageLoader.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.io.IOException; import java.io.InputStream; @@ -35,9 +35,6 @@ import java.util.logging.Logger; import org.x4o.xml.eld.EldDriver; import org.x4o.xml.eld.EldModuleLoader; -import org.x4o.xml.element.ElementLanguageModule; -import org.x4o.xml.element.ElementLanguageModuleLoader; -import org.x4o.xml.element.ElementLanguageModuleLoaderSibling; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -83,7 +80,7 @@ public class DefaultX4OLanguageLoader implements X4OLanguageLoader { } /** - * @see org.x4o.xml.core.config.X4OLanguageLoader#loadLanguage(org.x4o.xml.element.ElementLanguage, java.lang.String, java.lang.String) + * @see org.x4o.xml.lang.X4OLanguageLoader#loadLanguage(org.x4o.xml.element.ElementLanguage, java.lang.String, java.lang.String) */ public void loadLanguage(X4OLanguageLocal languageLocal, String language,String languageVersion) throws X4OLanguageLoaderException { try { @@ -106,14 +103,14 @@ public class DefaultX4OLanguageLoader implements X4OLanguageLoader { for (String key:modules.keySet()) { String value = modules.get(key); - ElementLanguageModule module = (ElementLanguageModule)X4OLanguageClassLoader.newInstance(languageLocal.getLanguageConfiguration().getDefaultElementLanguageModule()); + X4OLanguageModule module = (X4OLanguageModule)X4OLanguageClassLoader.newInstance(languageLocal.getLanguageConfiguration().getDefaultElementLanguageModule()); module.setSourceResource(value); logMessage(languageLocal,"Parsing language config key: "+key+" value: "+value); if ("module-loader".equals(key)) { try { - module.setElementLanguageModuleLoader( (ElementLanguageModuleLoader)X4OLanguageClassLoader.loadClass(value).newInstance() ); + module.setLanguageModuleLoader( (X4OLanguageModuleLoader)X4OLanguageClassLoader.loadClass(value).newInstance() ); } catch (Exception ee) { throw new SAXException("Could not load: "+value+" error: "+ee.getMessage(),ee); } @@ -122,9 +119,9 @@ public class DefaultX4OLanguageLoader implements X4OLanguageLoader { String languagePrefix = languageLocal.getLanguageConfiguration().getLanguageResourcePathPrefix(); String resource = languagePrefix+"/"+language+"/"+value; if (language.equals(EldDriver.LANGUAGE_NAME)) { - module.setElementLanguageModuleLoader(new EldModuleLoader(resource,true)); // load cel + module.setLanguageModuleLoader(new EldModuleLoader(resource,true)); // load cel } else { - module.setElementLanguageModuleLoader(new EldModuleLoader(resource,false)); // load eld + module.setLanguageModuleLoader(new EldModuleLoader(resource,false)); // load eld } module.setSourceResource(resource); } else if ("elb-resource".equals(key)) { @@ -134,22 +131,22 @@ public class DefaultX4OLanguageLoader implements X4OLanguageLoader { } else if ("sibling-loader".equals(key)) { try { - module.setElementLanguageModuleLoader( (ElementLanguageModuleLoaderSibling)X4OLanguageClassLoader.loadClass(value).newInstance() ); + module.setLanguageModuleLoader( (X4OLanguageModuleLoaderSibling)X4OLanguageClassLoader.loadClass(value).newInstance() ); } catch (Exception ee) { throw new SAXException("Could not load: "+value+" error: "+ee.getMessage(),ee); } } - if (module.getElementLanguageModuleLoader()==null) { + if (module.getLanguageModuleLoader()==null) { logger.warning("module with null loader: "+module+" tag: "+key+" chars: "+value); continue; } // mmm start in order ? logMessage(languageLocal,"Starting modules: "+module+" for language: "+language); - module.getElementLanguageModuleLoader().loadLanguageModule(languageLocal, module); + module.getLanguageModuleLoader().loadLanguageModule(languageLocal, module); - languageLocal.addElementLanguageModule(module); + languageLocal.addLanguageModule(module); } } } catch (Exception e1) { diff --git a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguageModule.java b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageModule.java similarity index 89% rename from x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguageModule.java rename to x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageModule.java index 5a0fcbb..8f9e4b8 100644 --- a/x4o-core/src/main/java/org/x4o/xml/impl/DefaultElementLanguageModule.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageModule.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.lang; -import org.x4o.xml.element.AbstractElementLanguageModule; /** * An DefaultElementLanguageModule. @@ -31,6 +30,6 @@ import org.x4o.xml.element.AbstractElementLanguageModule; * @author Willem Cazander * @version 1.0 Aug 2, 2012 */ -public class DefaultElementLanguageModule extends AbstractElementLanguageModule { +public class DefaultX4OLanguageModule extends AbstractX4OLanguageModule { } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguageVersionFilter.java b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageVersionFilter.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguageVersionFilter.java rename to x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageVersionFilter.java index d688981..987efe3 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/DefaultX4OLanguageVersionFilter.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageVersionFilter.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.util.List; @@ -36,7 +36,7 @@ public class DefaultX4OLanguageVersionFilter implements X4OLanguageVersionFilter /** * Filters to the best version. - * @see org.x4o.xml.core.config.X4OLanguageVersionFilter#filterVersion(java.lang.String, java.util.List) + * @see org.x4o.xml.lang.X4OLanguageVersionFilter#filterVersion(java.lang.String, java.util.List) * @return The perfect or best match or null if no match for requested language. * @param requestVersion The language version to search for. * @param versions The list of version to search in. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguage.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguage.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguage.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguage.java index a79f31b..2566af7 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguage.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguage.java @@ -21,15 +21,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.util.List; -import org.x4o.xml.core.phase.X4OPhaseManager; import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.lang.phase.X4OPhaseManager; /** * X4OLanguage hold the defined language. @@ -85,5 +84,5 @@ public interface X4OLanguage { /** * @return Returns a list of element language modules in this defined and loaded language. */ - List getElementLanguageModules(); + List getLanguageModules(); } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageClassLoader.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageClassLoader.java similarity index 99% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageClassLoader.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageClassLoader.java index f243c89..f2ceaba 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageClassLoader.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageClassLoader.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; /** * X4OLanguageClassLoader is short hand for safe class loading. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageConfiguration.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java similarity index 87% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageConfiguration.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java index 6fed77a..c307fb8 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageConfiguration.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageConfiguration.java @@ -21,13 +21,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.util.List; import java.util.Map; import org.x4o.xml.X4ODriver; -import org.x4o.xml.element.ElementLanguage; /** @@ -85,30 +84,30 @@ public interface X4OLanguageConfiguration { * Creates and filles the inital element language used to store the language. * @return The newly created ElementLanguage. */ - ElementLanguage createElementLanguage(X4ODriver driver); + X4OLanguageContext createElementLanguage(X4ODriver driver); /** * @return Returns Map of SAX properties which are set. */ - Map getSAXParserProperties(ElementLanguage elementContext); + Map getSAXParserProperties(X4OLanguageContext elementContext); /** * @return Returns Map of SAX properties which are optional set. */ - Map getSAXParserPropertiesOptional(ElementLanguage elementContext); + Map getSAXParserPropertiesOptional(X4OLanguageContext elementContext); /** * @return Returns Map of SAX features which are set on the xml parser. */ - Map getSAXParserFeatures(ElementLanguage elementContext); + Map getSAXParserFeatures(X4OLanguageContext elementContext); /** * @return Returns Map of SAX features which are optional set. */ - Map getSAXParserFeaturesOptional(ElementLanguage elementContext); + Map getSAXParserFeaturesOptional(X4OLanguageContext elementContext); /** * @return Returns List of SAX features which are required for xml parsing. */ - List getSAXParserFeaturesRequired(ElementLanguage elementContext); + List getSAXParserFeaturesRequired(X4OLanguageContext elementContext); } diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguage.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageContext.java similarity index 90% rename from x4o-core/src/main/java/org/x4o/xml/element/ElementLanguage.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageContext.java index 1d7ca86..a8e3d58 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguage.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageContext.java @@ -21,17 +21,18 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; import java.util.Map; import javax.el.ELContext; import javax.el.ExpressionFactory; -import org.x4o.xml.core.X4ODebugWriter; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguageProperty; -import org.x4o.xml.core.phase.X4OPhase; +import org.x4o.xml.element.Element; +import org.x4o.xml.element.ElementAttributeValueParser; +import org.x4o.xml.element.ElementObjectPropertyValue; +import org.x4o.xml.io.sax.X4ODebugWriter; +import org.x4o.xml.lang.phase.X4OPhase; /** * ElementLanguage is the central store of the defined element language. @@ -39,7 +40,7 @@ import org.x4o.xml.core.phase.X4OPhase; * @author Willem Cazander * @version 1.0 Feb 14, 2007 */ -public interface ElementLanguage { +public interface X4OLanguageContext { X4OLanguage getLanguage(); @@ -47,13 +48,13 @@ public interface ElementLanguage { * Gets the EL Context. * @return Returns the ELContext. */ - ELContext getELContext(); + ELContext getExpressionLanguageContext(); /** * Gets the ExpressionFactory. * @return Returns the ExpressionFactory. */ - ExpressionFactory getExpressionFactory(); + ExpressionFactory getExpressionLanguageFactory(); /** * @return Returns the ElementAttributeValueParser. diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageLocal.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageContextLocal.java similarity index 85% rename from x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageLocal.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageContextLocal.java index b9d6c4c..091748d 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageLocal.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageContextLocal.java @@ -21,12 +21,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; import javax.el.ELContext; import javax.el.ExpressionFactory; -import org.x4o.xml.core.X4ODebugWriter; +import org.x4o.xml.element.ElementAttributeValueParser; +import org.x4o.xml.element.ElementObjectPropertyValue; +import org.x4o.xml.io.sax.X4ODebugWriter; /** * ElementLanguageLocal is the local set interface for ElementLanguage. @@ -34,19 +36,19 @@ import org.x4o.xml.core.X4ODebugWriter; * @author Willem Cazander * @version 1.0 Oct 28, 2009 */ -public interface ElementLanguageLocal extends ElementLanguage { +public interface X4OLanguageContextLocal extends X4OLanguageContext { /** * Sets the EL Context. * @param context The ELContext to set. */ - void setELContext(ELContext context); + void setExpressionLanguageContext(ELContext context); /** * Sets the ExpressionFactory. * @param expressionFactory The ExpressionFactory to set. */ - void setExpressionFactory(ExpressionFactory expressionFactory); + void setExpressionLanguageFactory(ExpressionFactory expressionFactory); /** * @param elementAttributeValueParser The elementAttributeValueParser to set. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLoader.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLoader.java similarity index 98% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLoader.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLoader.java index dac788e..a1e45d4 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLoader.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLoader.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; /** * Loads the language into the contexts. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLoaderException.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLoaderException.java similarity index 98% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLoaderException.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLoaderException.java index 7b51d87..8b0455a 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLoaderException.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLoaderException.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; /** * Is throw when there is en Exception within an Element. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLocal.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLocal.java similarity index 85% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLocal.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLocal.java index b127eb6..c51ccbf 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageLocal.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageLocal.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; -import org.x4o.xml.element.ElementLanguageModule; /** * X4OLanguageLocal exposes the add method to load the language. @@ -40,8 +39,8 @@ public interface X4OLanguageLocal extends X4OLanguage { */ /** - * Adds an ElementLanguageModule to this language. - * @param elementLanguageModule The element language module to add. + * Adds an X4OLanguageModule to this language. + * @param languageModule The element language module to add. */ - void addElementLanguageModule(ElementLanguageModule elementLanguageModule); + void addLanguageModule(X4OLanguageModule languageModule); } diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModule.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java similarity index 89% rename from x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModule.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java index 1e4a9ee..01254d7 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModule.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModule.java @@ -21,10 +21,17 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +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; +import org.x4o.xml.element.ElementMetaBase; +import org.x4o.xml.element.ElementNamespaceContext; + /** * The ElementLanguageModule.
* This is an central store to element interfaces from one language module @@ -32,7 +39,7 @@ import java.util.List; * @author Willem Cazander * @version 1.0 Aug 2, 2012 */ -public interface ElementLanguageModule extends ElementMetaBase { +public interface X4OLanguageModule extends ElementMetaBase { /** * @return the Name. @@ -123,12 +130,12 @@ public interface ElementLanguageModule extends ElementMetaBase { /** * @param elementLanguageModuleLoader Sets the loader of this module. */ - void setElementLanguageModuleLoader(ElementLanguageModuleLoader elementLanguageModuleLoader); + void setLanguageModuleLoader(X4OLanguageModuleLoader elementLanguageModuleLoader); /** * @return Returns the ElementLanguageModuleLoader of this module. */ - ElementLanguageModuleLoader getElementLanguageModuleLoader(); + X4OLanguageModuleLoader getLanguageModuleLoader(); /** * @return the sourceResource diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoader.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoader.java similarity index 81% rename from x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoader.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoader.java index eacd1d8..bb19dfb 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoader.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoader.java @@ -21,9 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; -import org.x4o.xml.core.config.X4OLanguageLocal; /** @@ -34,13 +33,13 @@ import org.x4o.xml.core.config.X4OLanguageLocal; * @author Willem Cazander * @version 1.0 Jul 8, 2006 */ -public interface ElementLanguageModuleLoader { +public interface X4OLanguageModuleLoader { /** * Starts the ElementProvider. * @param languageLocal The ElementLanguage to load for. * @param elementLanguageModule The ElementLanguageModule to load it into. - * @throws ElementLanguageModuleLoaderException Gets thrown when modules could not be correctly loaded. + * @throws X4OLanguageModuleLoaderException Gets thrown when modules could not be correctly loaded. */ - void loadLanguageModule(X4OLanguageLocal languageLocal,ElementLanguageModule elementLanguageModule) throws ElementLanguageModuleLoaderException; + void loadLanguageModule(X4OLanguageLocal languageLocal,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException; } diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoaderException.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoaderException.java similarity index 81% rename from x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoaderException.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoaderException.java index 9bb9e42..5f6bbab 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoaderException.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoaderException.java @@ -21,7 +21,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; + +import org.x4o.xml.element.ElementException; /** * ElementNamespaceLoaderException holds ElementLanguageModuleLoader which created the exception.
@@ -30,16 +32,16 @@ package org.x4o.xml.element; * @version 1.0 Aug 29, 2008 */ @SuppressWarnings("serial") -public class ElementLanguageModuleLoaderException extends ElementException { +public class X4OLanguageModuleLoaderException extends ElementException { - private ElementLanguageModuleLoader elementLanguageModuleLoader = null; + private X4OLanguageModuleLoader elementLanguageModuleLoader = null; /** * Creates module loader exception. * @param elementLanguageModuleLoader The loader module which creates this exception. * @param message The message of the exception. */ - public ElementLanguageModuleLoaderException(ElementLanguageModuleLoader elementLanguageModuleLoader,String message) { + public X4OLanguageModuleLoaderException(X4OLanguageModuleLoader elementLanguageModuleLoader,String message) { super(message); this.elementLanguageModuleLoader=elementLanguageModuleLoader; } @@ -50,7 +52,7 @@ public class ElementLanguageModuleLoaderException extends ElementException { * @param message The message of the exception. * @param exception The root cause of the exception. */ - public ElementLanguageModuleLoaderException(ElementLanguageModuleLoader elementLanguageModuleLoader,String message,Exception exception) { + public X4OLanguageModuleLoaderException(X4OLanguageModuleLoader elementLanguageModuleLoader,String message,Exception exception) { super(message,exception); this.elementLanguageModuleLoader=elementLanguageModuleLoader; } @@ -59,7 +61,7 @@ public class ElementLanguageModuleLoaderException extends ElementException { * Returns the module loader which created the exception. * @return Returns the module loader. */ - public ElementLanguageModuleLoader getElementProvider() { + public X4OLanguageModuleLoader getElementProvider() { return elementLanguageModuleLoader; } } diff --git a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoaderSibling.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoaderSibling.java similarity index 87% rename from x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoaderSibling.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoaderSibling.java index 4a23a32..ae03903 100644 --- a/x4o-core/src/main/java/org/x4o/xml/element/ElementLanguageModuleLoaderSibling.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageModuleLoaderSibling.java @@ -21,11 +21,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.element; +package org.x4o.xml.lang; -import org.x4o.xml.core.config.X4OLanguageLoader; -import org.x4o.xml.core.config.X4OLanguageLoaderException; -import org.x4o.xml.core.config.X4OLanguageLocal; /** @@ -35,7 +32,7 @@ import org.x4o.xml.core.config.X4OLanguageLocal; * @author Willem Cazander * @version 1.0 Aug 7, 2012 */ -public interface ElementLanguageModuleLoaderSibling extends ElementLanguageModuleLoader { +public interface X4OLanguageModuleLoaderSibling extends X4OLanguageModuleLoader { /** * Loads in the sibling language. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageProperty.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageProperty.java similarity index 99% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageProperty.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageProperty.java index 919d672..507f36e 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageProperty.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageProperty.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.io.File; import java.io.InputStream; diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguagePropertyKeys.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguagePropertyKeys.java similarity index 99% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguagePropertyKeys.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguagePropertyKeys.java index b25e4bf..3196a81 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguagePropertyKeys.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguagePropertyKeys.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; /** * X4OLanguagePropertyKeys is shortcut to the the properties by uri. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageVersionFilter.java b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageVersionFilter.java similarity index 98% rename from x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageVersionFilter.java rename to x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageVersionFilter.java index 8ac6eec..8286a8d 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/X4OLanguageVersionFilter.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/X4OLanguageVersionFilter.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; import java.util.List; diff --git a/x4o-core/src/main/java/org/x4o/xml/core/config/package-info.java b/x4o-core/src/main/java/org/x4o/xml/lang/package-info.java similarity index 97% rename from x4o-core/src/main/java/org/x4o/xml/core/config/package-info.java rename to x4o-core/src/main/java/org/x4o/xml/lang/package-info.java index e61e89a..75e5954 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/config/package-info.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/package-info.java @@ -28,4 +28,4 @@ * @since 1.0 */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/AbstractX4OPhase.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/AbstractX4OPhase.java similarity index 94% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/AbstractX4OPhase.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/AbstractX4OPhase.java index ee1e8dc..cad46d1 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/AbstractX4OPhase.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/AbstractX4OPhase.java @@ -21,13 +21,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; import java.util.ArrayList; import java.util.List; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; /** @@ -98,6 +98,6 @@ public abstract class AbstractX4OPhase implements X4OPhase { * @param elementLanguage The language to run phase for. * @throws X4OPhaseException when phase has error. */ - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { } } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/DefaultX4OPhaseManager.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java similarity index 95% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/DefaultX4OPhaseManager.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java index 7dd1d7b..e97a13a 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/DefaultX4OPhaseManager.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java @@ -21,16 +21,16 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageProperty; /** @@ -124,7 +124,7 @@ public class DefaultX4OPhaseManager implements X4OPhaseManager { * Runs all the phases in the right order. * @throws X4OPhaseException When a running handlers throws one. */ - public void runPhases(ElementLanguage languageContext,X4OPhaseType type) throws X4OPhaseException { + public void runPhases(X4OLanguageContext languageContext,X4OPhaseType type) throws X4OPhaseException { // sort for the order List x4oPhasesOrder = getOrderedPhases(type); @@ -198,7 +198,7 @@ public class DefaultX4OPhaseManager implements X4OPhaseManager { * @throws X4OPhaseException When a running handlers throws one. */ public void runPhasesForElement(Element e,X4OPhaseType type,X4OPhase p) throws X4OPhaseException { - ElementLanguage languageContext = e.getElementLanguage(); + X4OLanguageContext languageContext = e.getElementLanguage(); boolean skipRunPhase = languageContext.getLanguagePropertyBoolean(X4OLanguageProperty.PHASE_SKIP_RUN); String stopPhase = languageContext.getLanguagePropertyString(X4OLanguageProperty.PHASE_STOP_AFTER); @@ -235,7 +235,7 @@ public class DefaultX4OPhaseManager implements X4OPhaseManager { * Run release phase manual if auto release is disabled by config. * @throws X4OPhaseException When a running handlers throws one. */ - public void doReleasePhaseManual(ElementLanguage languageContext) throws X4OPhaseException { + public void doReleasePhaseManual(X4OLanguageContext languageContext) throws X4OPhaseException { boolean skipReleasePhase = languageContext.getLanguagePropertyBoolean(X4OLanguageProperty.PHASE_SKIP_RELEASE); if (skipReleasePhase==false) { throw new IllegalStateException("No manual release requested."); @@ -327,7 +327,7 @@ public class DefaultX4OPhaseManager implements X4OPhaseManager { * @param phase The phase to run. * @throws X4OPhaseException When a running handlers throws one. */ - private void executePhaseRoot(ElementLanguage elementLanguage,X4OPhase phase) throws X4OPhaseException { + private void executePhaseRoot(X4OLanguageContext elementLanguage,X4OPhase phase) throws X4OPhaseException { if (elementLanguage.getRootElement()==null) { return; } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhase.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java similarity index 95% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhase.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java index f238e98..9c38b6f 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhase.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java @@ -21,12 +21,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; import java.util.List; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; /** @@ -58,7 +58,7 @@ public interface X4OPhase { * @param elementLanguage The elementLanguage running this phase. * @throws X4OPhaseException When error has happend. */ - void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException; + void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException; /** * Returns all phase listeners which where added. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseException.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseException.java similarity index 98% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseException.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseException.java index cfeaeac..1e97ea2 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseException.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseException.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; /** * Is throw when there is en Exception within an Element. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseFactory.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseFactory.java similarity index 92% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseFactory.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseFactory.java index 9f56861..1ace5fc 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseFactory.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseFactory.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; import java.io.InputStream; import java.util.ArrayList; @@ -34,14 +34,6 @@ import java.util.logging.Logger; import javax.el.ValueExpression; import org.x4o.xml.conv.ObjectConverterException; -import org.x4o.xml.core.X4ODebugWriter; -import org.x4o.xml.core.X4OEntityResolver; -import org.x4o.xml.core.X4OErrorHandler; -import org.x4o.xml.core.X4OTagHandler; -import org.x4o.xml.core.config.X4OLanguageClassLoader; -import org.x4o.xml.core.config.X4OLanguageLoader; -import org.x4o.xml.core.config.X4OLanguageLocal; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.element.Element; import org.x4o.xml.element.ElementAttributeHandler; @@ -51,12 +43,20 @@ import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; import org.x4o.xml.element.ElementConfigurator; import org.x4o.xml.element.ElementConfiguratorGlobal; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementException; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; -import org.x4o.xml.element.ElementLanguageModuleLoaderSibling; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.io.sax.X4ODebugWriter; +import org.x4o.xml.io.sax.X4OEntityResolver; +import org.x4o.xml.io.sax.X4OErrorHandler; +import org.x4o.xml.io.sax.X4OTagHandler; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageModuleLoaderSibling; +import org.x4o.xml.lang.X4OLanguageClassLoader; +import org.x4o.xml.lang.X4OLanguageLoader; +import org.x4o.xml.lang.X4OLanguageLocal; +import org.x4o.xml.lang.X4OLanguageProperty; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -79,7 +79,7 @@ public class X4OPhaseFactory { logger = Logger.getLogger(X4OPhaseFactory.class.getName()); } - private void debugPhaseMessage(String message,X4OPhase phaseHandler,ElementLanguage languageContext) throws X4OPhaseException { + private void debugPhaseMessage(String message,X4OPhase phaseHandler,X4OLanguageContext languageContext) throws X4OPhaseException { if (languageContext.hasX4ODebugWriter()) { try { languageContext.getX4ODebugWriter().debugPhaseMessage(message,phaseHandler.getClass()); @@ -110,7 +110,7 @@ public class X4OPhaseFactory { public void runElementPhase(Element element) throws X4OPhaseException { // not used. } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { } }; @@ -139,7 +139,7 @@ public class X4OPhaseFactory { } public void runElementPhase(Element element) throws X4OPhaseException { } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { try { debugPhaseMessage("Loading main language: "+elementLanguage.getLanguage(),this,elementLanguage); X4OLanguageLoader loader = (X4OLanguageLoader)X4OLanguageClassLoader.newInstance(elementLanguage.getLanguage().getLanguageConfiguration().getDefaultX4OLanguageLoader()); @@ -177,17 +177,17 @@ public class X4OPhaseFactory { } public void runElementPhase(Element element) throws X4OPhaseException { } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { try { - List siblingLoaders = new ArrayList(3); - for (ElementLanguageModule module:elementLanguage.getLanguage().getElementLanguageModules()) { - if (module.getElementLanguageModuleLoader() instanceof ElementLanguageModuleLoaderSibling) { - siblingLoaders.add((ElementLanguageModuleLoaderSibling)module.getElementLanguageModuleLoader()); + List siblingLoaders = new ArrayList(3); + for (X4OLanguageModule module:elementLanguage.getLanguage().getLanguageModules()) { + if (module.getLanguageModuleLoader() instanceof X4OLanguageModuleLoaderSibling) { + siblingLoaders.add((X4OLanguageModuleLoaderSibling)module.getLanguageModuleLoader()); } } if (siblingLoaders.isEmpty()==false) { X4OLanguageLoader loader = (X4OLanguageLoader)X4OLanguageClassLoader.newInstance(elementLanguage.getLanguage().getLanguageConfiguration().getDefaultX4OLanguageLoader()); - for (ElementLanguageModuleLoaderSibling siblingLoader:siblingLoaders) { + for (X4OLanguageModuleLoaderSibling siblingLoader:siblingLoaders) { debugPhaseMessage("Loading sibling langauge loader: "+siblingLoader,this,elementLanguage); siblingLoader.loadLanguageSibling((X4OLanguageLocal)elementLanguage.getLanguage(), loader); } @@ -225,7 +225,7 @@ public class X4OPhaseFactory { public void runElementPhase(Element element) throws X4OPhaseException { // not used. } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { // print the properties and classes for this language/config if (elementLanguage.hasX4ODebugWriter()) { try { @@ -262,7 +262,7 @@ public class X4OPhaseFactory { } public void runElementPhase(Element element) throws X4OPhaseException { } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { try { //XMLParserConfiguration config = new XIncludeAwareParserConfiguration(); //config.setProperty("http://apache.org/xml/properties/internal/grammar-pool",myFullGrammarPool); @@ -383,7 +383,7 @@ public class X4OPhaseFactory { // not used. } @SuppressWarnings("rawtypes") - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { try { Map beanMap = (Map)elementLanguage.getLanguageProperty(X4OLanguageProperty.EL_BEAN_INSTANCE_MAP); if (beanMap==null) { @@ -391,8 +391,8 @@ public class X4OPhaseFactory { } for (Object elName:beanMap.keySet()) { Object o = beanMap.get(elName); - ValueExpression ve = elementLanguage.getExpressionFactory().createValueExpression(elementLanguage.getELContext(),"${"+elName+"}", o.getClass()); - ve.setValue(elementLanguage.getELContext(), o); + ValueExpression ve = elementLanguage.getExpressionLanguageFactory().createValueExpression(elementLanguage.getExpressionLanguageContext(),"${"+elName+"}", o.getClass()); + ve.setValue(elementLanguage.getExpressionLanguageContext(), o); debugPhaseMessage("Setting el bean: ${"+elName+"} to: "+o.getClass().getName(),this,elementLanguage); } } catch (Exception e) { @@ -495,7 +495,7 @@ public class X4OPhaseFactory { return new String[] {"READ_CONFIG_ELEMENT","READ_CONFIG_ELEMENT_INTERFACE"}; } public void runElementPhase(Element element) throws X4OPhaseException { - for (ElementLanguageModule mod:element.getElementLanguage().getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:element.getElementLanguage().getLanguage().getLanguageModules()) { logger.finest("Do Element Config Global Configurators: "+mod.getElementConfiguratorGlobals().size()); for (ElementConfiguratorGlobal ec:mod.getElementConfiguratorGlobals()) { runConf.runElementConfigurator(ec,element,this); @@ -536,7 +536,7 @@ public class X4OPhaseFactory { // do global parameters logger.finest("Do Element Global AttributeHandlers."); List handlers = new ArrayList(); - for (ElementLanguageModule mod:element.getElementLanguage().getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:element.getElementLanguage().getLanguage().getLanguageModules()) { for (ElementAttributeHandler global:mod.getElementAttributeHandlers()) { String attribute = element.getAttributes().get(global.getAttributeName()); @@ -578,10 +578,6 @@ public class X4OPhaseFactory { return; } - if (element.getElementLanguage().getLanguage().getLanguageName().equals("test")) { - System.out.println("do element; "+element.getElementClass().getTag()+" attr; "+element.getAttributes()); - } - // do config Map attr = element.getAttributes(); ElementAttributeValueParser attrParser = element.getElementLanguage().getElementAttributeValueParser(); @@ -860,7 +856,7 @@ public class X4OPhaseFactory { public boolean isElementPhase() { return false; } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { for (RunConfigurator conf:runConf) { try { if (elementLanguage.hasX4ODebugWriter()) { @@ -933,7 +929,7 @@ public class X4OPhaseFactory { public void runElementPhase(Element element) throws X4OPhaseException { // not used. } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { // print the properties and classes for this language/config if (elementLanguage.hasX4ODebugWriter()) { try { @@ -959,15 +955,15 @@ public class X4OPhaseFactory { class ReleasePhaseListener implements X4OPhaseListener { private int elementsReleased = 0; /** - * @see org.x4o.xml.core.phase.X4OPhaseListener#preRunPhase(org.x4o.xml.core.phase.X4OPhase, org.x4o.xml.element.ElementLanguage) + * @see org.x4o.xml.lang.phase.X4OPhaseListener#preRunPhase(org.x4o.xml.lang.phase.X4OPhase, org.x4o.xml.lang.X4OLanguageContext) */ - public void preRunPhase(X4OPhase phase,ElementLanguage elementLanguage) throws X4OPhaseException { + public void preRunPhase(X4OPhase phase,X4OLanguageContext elementLanguage) throws X4OPhaseException { elementsReleased=0; } /** - * @see org.x4o.xml.core.phase.X4OPhaseListener#endRunPhase(org.x4o.xml.core.phase.X4OPhase, org.x4o.xml.element.ElementLanguage) + * @see org.x4o.xml.lang.phase.X4OPhaseListener#endRunPhase(org.x4o.xml.lang.phase.X4OPhase, org.x4o.xml.lang.X4OLanguageContext) */ - public void endRunPhase(X4OPhase phase,ElementLanguage elementLanguage) throws X4OPhaseException { + public void endRunPhase(X4OPhase phase,X4OLanguageContext elementLanguage) throws X4OPhaseException { if (elementLanguage.hasX4ODebugWriter()==false) { return; } @@ -997,7 +993,7 @@ public class X4OPhaseFactory { public String[] getPhaseDependencies() { return new String[] {"READ_END"}; } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { } public void runElementPhase(Element element) throws X4OPhaseException { try { @@ -1033,7 +1029,7 @@ public class X4OPhaseFactory { } public void runElementPhase(Element element) throws X4OPhaseException { } - public void runPhase(ElementLanguage elementLanguage) throws X4OPhaseException { + public void runPhase(X4OLanguageContext elementLanguage) throws X4OPhaseException { // safety check if (elementLanguage.hasX4ODebugWriter()==false) { throw new X4OPhaseException(this,"Use debugPhase only when X4OParser.debugWriter is filled."); @@ -1058,7 +1054,7 @@ public class X4OPhaseFactory { // note: slow version private String getNamespaceForElement(Element e) { - for (ElementLanguageModule mod:e.getElementLanguage().getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:e.getElementLanguage().getLanguage().getLanguageModules()) { for (ElementNamespaceContext enc:mod.getElementNamespaceContexts()) { List l = enc.getElementClasses(); if (l.contains(e.getElementClass())) { diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseListener.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseListener.java similarity index 88% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseListener.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseListener.java index a27518b..ecc954e 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseListener.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseListener.java @@ -21,9 +21,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; /** @@ -41,7 +41,7 @@ public interface X4OPhaseListener { * @param elementLanguage The elementLanguage of the driver. * @throws X4OPhaseException Is throws when listeners has error. */ - void preRunPhase(X4OPhase phase,ElementLanguage elementLanguage) throws X4OPhaseException; + void preRunPhase(X4OPhase phase,X4OLanguageContext elementLanguage) throws X4OPhaseException; /** * Gets called after the X4OPhaseHandler is runned. @@ -49,5 +49,5 @@ public interface X4OPhaseListener { * @param elementLanguage The elementLanguage of the driver. * @throws X4OPhaseException Is throws when listeners has error. */ - void endRunPhase(X4OPhase phase,ElementLanguage elementLanguage) throws X4OPhaseException; + void endRunPhase(X4OPhase phase,X4OLanguageContext elementLanguage) throws X4OPhaseException; } diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseManager.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseManager.java similarity index 89% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseManager.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseManager.java index 7f4ff0b..c45b549 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseManager.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseManager.java @@ -21,13 +21,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; import java.util.Collection; import java.util.List; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; /** @@ -51,13 +51,13 @@ public interface X4OPhaseManager { */ List getOrderedPhases(X4OPhaseType type); - public void doReleasePhaseManual(ElementLanguage languageContext) throws X4OPhaseException; + public void doReleasePhaseManual(X4OLanguageContext languageContext) throws X4OPhaseException; /** * Runs all the phases in the right order. * @throws X4OPhaseException When a running handlers throws one. */ - public void runPhases(ElementLanguage elementContext,X4OPhaseType type) throws X4OPhaseException; + public void runPhases(X4OLanguageContext elementContext,X4OPhaseType type) throws X4OPhaseException; /** * Runs phase on single element. diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseManagerFactory.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseManagerFactory.java similarity index 98% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseManagerFactory.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseManagerFactory.java index 775b80d..fe680c1 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseManagerFactory.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseManagerFactory.java @@ -21,13 +21,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; import java.util.List; -import org.x4o.xml.core.phase.X4OPhaseFactory.X4OPhaseReadRunConfigurator; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.phase.X4OPhaseFactory.X4OPhaseReadRunConfigurator; /** diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseType.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseType.java similarity index 97% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseType.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseType.java index 32e8dec..e3295c7 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/X4OPhaseType.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/X4OPhaseType.java @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.phase; +package org.x4o.xml.lang.phase; /** * X4OPhaseType diff --git a/x4o-core/src/main/java/org/x4o/xml/core/phase/package-info.java b/x4o-core/src/main/java/org/x4o/xml/lang/phase/package-info.java similarity index 97% rename from x4o-core/src/main/java/org/x4o/xml/core/phase/package-info.java rename to x4o-core/src/main/java/org/x4o/xml/lang/phase/package-info.java index a113d9f..ea57344 100644 --- a/x4o-core/src/main/java/org/x4o/xml/core/phase/package-info.java +++ b/x4o-core/src/main/java/org/x4o/xml/lang/phase/package-info.java @@ -27,4 +27,4 @@ * @since 1.0 */ -package org.x4o.xml.core.phase; \ No newline at end of file +package org.x4o.xml.lang.phase; \ No newline at end of file diff --git a/x4o-core/src/test/java/org/x4o/xml/X4ODriverManagerTest.java b/x4o-core/src/test/java/org/x4o/xml/X4ODriverManagerTest.java index bc62b0d..363d48a 100644 --- a/x4o-core/src/test/java/org/x4o/xml/X4ODriverManagerTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/X4ODriverManagerTest.java @@ -26,8 +26,8 @@ package org.x4o.xml; import java.util.List; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.core.config.X4OLanguageLoaderException; -import org.x4o.xml.core.phase.X4OPhaseException; +import org.x4o.xml.lang.X4OLanguageLoaderException; +import org.x4o.xml.lang.phase.X4OPhaseException; import junit.framework.TestCase; diff --git a/x4o-core/src/test/java/org/x4o/xml/conv/DefaultObjectConverterProviderTest.java b/x4o-core/src/test/java/org/x4o/xml/conv/DefaultObjectConverterProviderTest.java index 3246f34..71b6fbc 100644 --- a/x4o-core/src/test/java/org/x4o/xml/conv/DefaultObjectConverterProviderTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/conv/DefaultObjectConverterProviderTest.java @@ -30,7 +30,7 @@ import java.util.Locale; import org.x4o.xml.conv.text.ClassConverter; import org.x4o.xml.conv.text.EnumConverter; import org.x4o.xml.conv.text.URLConverter; -import org.x4o.xml.core.phase.X4OPhaseType; +import org.x4o.xml.lang.phase.X4OPhaseType; import junit.framework.TestCase; diff --git a/x4o-core/src/test/java/org/x4o/xml/core/NamespaceUriTest.java b/x4o-core/src/test/java/org/x4o/xml/core/NamespaceUriTest.java index 1860cd0..266e2ee 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/NamespaceUriTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/core/NamespaceUriTest.java @@ -23,9 +23,9 @@ package org.x4o.xml.core; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.io.X4OReaderContext; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; @@ -40,7 +40,7 @@ import junit.framework.TestCase; public class NamespaceUriTest extends TestCase { public void testSimpleUri() throws Exception { - ElementLanguage context = null; + X4OLanguageContext context = null; TestDriver driver = TestDriver.getInstance(); X4OReaderContext reader = driver.createReaderContext(); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); @@ -53,7 +53,7 @@ public class NamespaceUriTest extends TestCase { } public void testEmptyUri() throws Exception { - ElementLanguage context = null; + X4OLanguageContext context = null; TestDriver driver = TestDriver.getInstance(); X4OReaderContext reader = driver.createReaderContext(); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); @@ -67,7 +67,7 @@ public class NamespaceUriTest extends TestCase { } public void testSchemaUri() throws Exception { - ElementLanguage context = null; + X4OLanguageContext context = null; TestDriver driver = TestDriver.getInstance(); X4OReaderContext reader = driver.createReaderContext(); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); diff --git a/x4o-core/src/test/java/org/x4o/xml/core/X4ODebugWriterTest.java b/x4o-core/src/test/java/org/x4o/xml/core/X4ODebugWriterTest.java index c4427a8..201eaba 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/X4ODebugWriterTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/core/X4ODebugWriterTest.java @@ -28,8 +28,8 @@ import java.io.FileOutputStream; import java.io.IOException; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import org.x4o.xml.io.X4OReader; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; diff --git a/x4o-core/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java b/x4o-core/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java index d519684..46586ab 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java @@ -26,9 +26,10 @@ package org.x4o.xml.core; import java.io.IOException; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.X4OLanguageProperty; import org.x4o.xml.eld.CelDriver; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.io.sax.X4OEntityResolver; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguageProperty; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; import org.xml.sax.EntityResolver; @@ -80,7 +81,7 @@ public class X4OEntityResolverTest extends TestCase { public void testResolveProperty() throws Exception { X4ODriver driver = new TestDriver(); - ElementLanguage language = driver.createLanguageContext(); + X4OLanguageContext language = driver.createLanguageContext(); language.setLanguageProperty(X4OLanguageProperty.CONFIG_ENTITY_RESOLVER, new TestEntityResolver()); X4OEntityResolver resolver = new X4OEntityResolver(language); Exception e = null; @@ -96,7 +97,7 @@ public class X4OEntityResolverTest extends TestCase { public void testResolvePropertyNull() throws Exception { X4ODriver driver = new TestDriver(); - ElementLanguage language = driver.createLanguageContext(); + X4OLanguageContext language = driver.createLanguageContext(); language.setLanguageProperty(X4OLanguageProperty.CONFIG_ENTITY_RESOLVER, new TestEntityResolver()); X4OEntityResolver resolver = new X4OEntityResolver(language); Exception e = null; diff --git a/x4o-core/src/test/java/org/x4o/xml/core/X4OParserConfigurationTest.java b/x4o-core/src/test/java/org/x4o/xml/core/X4OParserConfigurationTest.java index d03a46c..a6bf597 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/X4OParserConfigurationTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/core/X4OParserConfigurationTest.java @@ -23,10 +23,10 @@ package org.x4o.xml.core; -import org.x4o.xml.core.config.X4OLanguageConfiguration; import org.x4o.xml.element.Element; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; +import org.x4o.xml.lang.X4OLanguageConfiguration; import org.x4o.xml.test.TestDriver; import junit.framework.TestCase; diff --git a/x4o-core/src/test/java/org/x4o/xml/core/X4OPhaseManagerTest.java b/x4o-core/src/test/java/org/x4o/xml/core/X4OPhaseManagerTest.java index bf9738b..613a1b9 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/X4OPhaseManagerTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/core/X4OPhaseManagerTest.java @@ -26,10 +26,10 @@ package org.x4o.xml.core; import java.util.Collection; import java.util.List; -import org.x4o.xml.core.phase.X4OPhase; -import org.x4o.xml.core.phase.X4OPhaseManager; -import org.x4o.xml.core.phase.X4OPhaseType; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.phase.X4OPhase; +import org.x4o.xml.lang.phase.X4OPhaseManager; +import org.x4o.xml.lang.phase.X4OPhaseType; import org.x4o.xml.test.TestDriver; @@ -51,7 +51,7 @@ public class X4OPhaseManagerTest extends TestCase { public void testPhases() throws Exception { TestDriver driver = TestDriver.getInstance(); - ElementLanguage context = driver.createLanguageContext(); + X4OLanguageContext context = driver.createLanguageContext(); X4OPhaseManager manager = context.getLanguage().getPhaseManager(); Collection phasesAll = manager.getAllPhases(); List phases = manager.getOrderedPhases(X4OPhaseType.XML_READ); diff --git a/x4o-core/src/test/java/org/x4o/xml/eld/EldParserTest.java b/x4o-core/src/test/java/org/x4o/xml/eld/EldParserTest.java index 082582e..68370a9 100644 --- a/x4o-core/src/test/java/org/x4o/xml/eld/EldParserTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/eld/EldParserTest.java @@ -29,17 +29,17 @@ import java.util.List; import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import org.x4o.xml.eld.EldDriver; import org.x4o.xml.element.Element; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.Element.ElementType; import org.x4o.xml.element.ElementClass; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; import org.x4o.xml.io.X4OReader; import org.x4o.xml.io.X4OSchemaWriter; import org.x4o.xml.io.X4OWriter; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.test.TestDriver; import junit.framework.TestCase; @@ -80,13 +80,13 @@ public class EldParserTest extends TestCase { public void testRunEldParserCore() throws Exception { - X4ODriver driver = (X4ODriver)X4ODriverManager.getX4ODriver(EldDriver.LANGUAGE_NAME); + X4ODriver driver = (X4ODriver)X4ODriverManager.getX4ODriver(EldDriver.LANGUAGE_NAME); - X4OReader reader = driver.createReader(); + X4OReader reader = driver.createReader(); //EldDriver parser = new EldDriver(true); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); try { - ElementLanguageModule module = reader.readResource("META-INF/eld/eld-lang.eld"); + X4OLanguageModule module = reader.readResource("META-INF/eld/eld-lang.eld"); List resultTags = new ArrayList(50); for (ElementNamespaceContext ns:module.getElementNamespaceContexts()) { @@ -118,8 +118,8 @@ public class EldParserTest extends TestCase { public void testRunEldParser() throws Exception { //EldDriver parser = new EldDriver(false); //parser.parseResource("META-INF/test/test-lang.eld"); - X4ODriver driver = (X4ODriver)X4ODriverManager.getX4ODriver(EldDriver.LANGUAGE_NAME); - X4OReader reader = driver.createReader(); + X4ODriver driver = (X4ODriver)X4ODriverManager.getX4ODriver(EldDriver.LANGUAGE_NAME); + X4OReader reader = driver.createReader(); reader.readResource("META-INF/test/test-lang.eld"); } } diff --git a/x4o-core/src/test/java/org/x4o/xml/eld/EldValidatingTest.java b/x4o-core/src/test/java/org/x4o/xml/eld/EldValidatingTest.java index 4658fbe..ba4d316 100644 --- a/x4o-core/src/test/java/org/x4o/xml/eld/EldValidatingTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/eld/EldValidatingTest.java @@ -24,9 +24,9 @@ package org.x4o.xml.eld; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import org.x4o.xml.eld.EldDriver; import org.x4o.xml.io.X4OReader; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; diff --git a/x4o-core/src/test/java/org/x4o/xml/impl/DefaultElementObjectPropertyValueTest.java b/x4o-core/src/test/java/org/x4o/xml/element/DefaultElementObjectPropertyValueTest.java similarity index 97% rename from x4o-core/src/test/java/org/x4o/xml/impl/DefaultElementObjectPropertyValueTest.java rename to x4o-core/src/test/java/org/x4o/xml/element/DefaultElementObjectPropertyValueTest.java index fe1b59c..bcb9a83 100644 --- a/x4o-core/src/test/java/org/x4o/xml/impl/DefaultElementObjectPropertyValueTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/element/DefaultElementObjectPropertyValueTest.java @@ -21,14 +21,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.element; import java.io.InputStream; import java.util.logging.LogManager; +import org.x4o.xml.element.DefaultElementObjectPropertyValue; import org.x4o.xml.element.ElementObjectPropertyValueException; -import org.x4o.xml.impl.DefaultElementObjectPropertyValue; import org.x4o.xml.test.models.TestObjectChild; import junit.framework.TestCase; diff --git a/x4o-core/src/test/java/org/x4o/xml/impl/DefaultX4OLanguageLoaderTest.java b/x4o-core/src/test/java/org/x4o/xml/lang/DefaultX4OLanguageLoaderTest.java similarity index 92% rename from x4o-core/src/test/java/org/x4o/xml/impl/DefaultX4OLanguageLoaderTest.java rename to x4o-core/src/test/java/org/x4o/xml/lang/DefaultX4OLanguageLoaderTest.java index 181364f..a52d5f2 100644 --- a/x4o-core/src/test/java/org/x4o/xml/impl/DefaultX4OLanguageLoaderTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/lang/DefaultX4OLanguageLoaderTest.java @@ -21,14 +21,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.impl; +package org.x4o.xml.lang; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.DefaultX4OLanguageLoader; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguageLoader; -import org.x4o.xml.core.config.X4OLanguageLocal; -import org.x4o.xml.io.X4OReader; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.X4OLanguageLoader; +import org.x4o.xml.lang.X4OLanguageLocal; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; diff --git a/x4o-core/src/test/java/org/x4o/xml/core/config/X4OLanguageClassLoaderTest.java b/x4o-core/src/test/java/org/x4o/xml/lang/X4OLanguageClassLoaderTest.java similarity index 96% rename from x4o-core/src/test/java/org/x4o/xml/core/config/X4OLanguageClassLoaderTest.java rename to x4o-core/src/test/java/org/x4o/xml/lang/X4OLanguageClassLoaderTest.java index 5238879..cdfd266 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/config/X4OLanguageClassLoaderTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/lang/X4OLanguageClassLoaderTest.java @@ -21,7 +21,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; + +import org.x4o.xml.lang.X4OLanguageClassLoader; import junit.framework.TestCase; diff --git a/x4o-core/src/test/java/org/x4o/xml/core/config/X4OLanguagePropertyTest.java b/x4o-core/src/test/java/org/x4o/xml/lang/X4OLanguagePropertyTest.java similarity index 97% rename from x4o-core/src/test/java/org/x4o/xml/core/config/X4OLanguagePropertyTest.java rename to x4o-core/src/test/java/org/x4o/xml/lang/X4OLanguagePropertyTest.java index dbcf268..1c47af8 100644 --- a/x4o-core/src/test/java/org/x4o/xml/core/config/X4OLanguagePropertyTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/lang/X4OLanguagePropertyTest.java @@ -21,9 +21,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.xml.core.config; +package org.x4o.xml.lang; + +import org.x4o.xml.lang.X4OLanguageProperty; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import junit.framework.TestCase; /** diff --git a/x4o-core/src/test/java/org/x4o/xml/test/SwingTests.java b/x4o-core/src/test/java/org/x4o/xml/test/SwingTests.java index 893c58c..9d727f7 100644 --- a/x4o-core/src/test/java/org/x4o/xml/test/SwingTests.java +++ b/x4o-core/src/test/java/org/x4o/xml/test/SwingTests.java @@ -26,8 +26,8 @@ package org.x4o.xml.test; import java.io.File; import java.io.FileOutputStream; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import org.x4o.xml.io.X4OReader; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.test.models.TestObjectRoot; diff --git a/x4o-core/src/test/java/org/x4o/xml/test/TagHandlerTest.java b/x4o-core/src/test/java/org/x4o/xml/test/TagHandlerTest.java index 860f9d3..462de9f 100644 --- a/x4o-core/src/test/java/org/x4o/xml/test/TagHandlerTest.java +++ b/x4o-core/src/test/java/org/x4o/xml/test/TagHandlerTest.java @@ -27,8 +27,8 @@ import java.io.File; import java.io.FileOutputStream; import org.x4o.xml.X4ODriver; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; import org.x4o.xml.io.X4OReader; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.test.models.TestObjectRoot; diff --git a/x4o-core/src/test/java/org/x4o/xml/test/swixml/SwiXmlDriver.java b/x4o-core/src/test/java/org/x4o/xml/test/swixml/SwiXmlDriver.java index 0beb3b5..0831cbd 100644 --- a/x4o-core/src/test/java/org/x4o/xml/test/swixml/SwiXmlDriver.java +++ b/x4o-core/src/test/java/org/x4o/xml/test/swixml/SwiXmlDriver.java @@ -29,12 +29,12 @@ import javax.el.ValueExpression; import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.core.config.DefaultX4OLanguage; -import org.x4o.xml.core.config.DefaultX4OLanguageConfiguration; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.core.phase.X4OPhaseManagerFactory; -import org.x4o.xml.element.ElementLanguage; +import org.x4o.xml.lang.DefaultX4OLanguage; +import org.x4o.xml.lang.DefaultX4OLanguageConfiguration; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; +import org.x4o.xml.lang.phase.X4OPhaseManagerFactory; /** * SwiXmlParser works with the SwingEngine to config the UI tree. @@ -91,9 +91,9 @@ public class SwiXmlDriver extends X4ODriver { * @param elementLanguage The elementLanguage to get the swingEngine out. * @return Returns the SwingEngine for this elementLanguage. */ - static public SwingEngine getSwingEngine(ElementLanguage elementLanguage) { - ValueExpression ee = elementLanguage.getExpressionFactory().createValueExpression(elementLanguage.getELContext(),"${"+SwiXmlDriver.LANGUAGE_EL_SWING_ENGINE+"}",Object.class); - SwingEngine se = (SwingEngine)ee.getValue(elementLanguage.getELContext()); + static public SwingEngine getSwingEngine(X4OLanguageContext elementLanguage) { + ValueExpression ee = elementLanguage.getExpressionLanguageFactory().createValueExpression(elementLanguage.getExpressionLanguageContext(),"${"+SwiXmlDriver.LANGUAGE_EL_SWING_ENGINE+"}",Object.class); + SwingEngine se = (SwingEngine)ee.getValue(elementLanguage.getExpressionLanguageContext()); return se; } diff --git a/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocGenerator.java b/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocGenerator.java index 1f3674b..90762db 100644 --- a/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocGenerator.java +++ b/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocGenerator.java @@ -30,10 +30,10 @@ import org.x4o.xml.element.ElementBindingHandler; import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementConfigurator; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementException; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; /** * EldDocGenerator writes documentation. @@ -43,9 +43,9 @@ import org.x4o.xml.element.ElementNamespaceContext; */ public class EldDocGenerator { - private ElementLanguage context = null; + private X4OLanguageContext context = null; - public EldDocGenerator(ElementLanguage context) { + public EldDocGenerator(X4OLanguageContext context) { this.context=context; } @@ -58,7 +58,7 @@ public class EldDocGenerator { writer.writeOverviewNamespace(basePath, context); writer.writeOverviewTree(basePath, context); - for (ElementLanguageModule mod:context.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) { writer.writeOverviewModule(basePath, mod); diff --git a/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocHtmlWriter.java b/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocHtmlWriter.java index f32f4c4..cb3cbb7 100644 --- a/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocHtmlWriter.java +++ b/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/EldDocHtmlWriter.java @@ -42,10 +42,10 @@ import org.x4o.xml.element.ElementClass; import org.x4o.xml.element.ElementClassAttribute; import org.x4o.xml.element.ElementConfigurator; import org.x4o.xml.element.ElementConfiguratorGlobal; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementInterface; -import org.x4o.xml.element.ElementLanguageModule; import org.x4o.xml.element.ElementNamespaceContext; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageContext; /** * EldDocHtmlWriter writes simple eld documentation. @@ -136,7 +136,7 @@ public class EldDocHtmlWriter { } } - public void writeIndex(File basePath,ElementLanguage context) throws IOException { + public void writeIndex(File basePath,X4OLanguageContext context) throws IOException { PrintWriter pw = createPrintWriter(basePath,"index.html"); try { String title = context.getLanguage().getLanguageName()+" "+context.getLanguage().getLanguageVersion()+" ELD"; @@ -149,7 +149,7 @@ public class EldDocHtmlWriter { int eleConfigs = 0; int elements = 0; int namespaces = 0; - for (ElementLanguageModule mod:context.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) { attrHandlers += mod.getElementAttributeHandlers().size(); bindHandlers += mod.getElementBindingHandlers().size(); interFaces += mod.getElementInterfaces().size(); @@ -164,7 +164,7 @@ public class EldDocHtmlWriter { printTableStart(pw,"Language Stats"); printTableRowSummary(pw,"Language:",""+context.getLanguage().getLanguageName()); printTableRowSummary(pw,"LanguageVersion:",""+context.getLanguage().getLanguageVersion()); - printTableRowSummary(pw,"Modules:",""+context.getLanguage().getElementLanguageModules().size()); + printTableRowSummary(pw,"Modules:",""+context.getLanguage().getLanguageModules().size()); printTableRowSummary(pw,"Namespaces:",""+namespaces); printTableRowSummary(pw,"Elements:",""+elements); printTableRowSummary(pw,"ElementInterfaces:",""+interFaces); @@ -181,16 +181,16 @@ public class EldDocHtmlWriter { } } - public void writeOverviewModule(File basePath,ElementLanguage context) throws IOException { + public void writeOverviewModule(File basePath,X4OLanguageContext context) throws IOException { PrintWriter pw = createPrintWriter(basePath,"module-overview.html"); try { String title = context.getLanguage().getLanguageName()+" "+context.getLanguage().getLanguageVersion()+" ELD"; printHeader(pw,"Overview Modules ("+title+")",""); printPageIndexTitle(pw,title,null,null); printTableStart(pw,"Modules"); - List mods = context.getLanguage().getElementLanguageModules(); + List mods = context.getLanguage().getLanguageModules(); Collections.sort(mods,new ElementLanguageModuleComparator()); - for (ElementLanguageModule mod:mods) { + for (X4OLanguageModule mod:mods) { printTableRowOverview(pw,toSafeUri(mod.getId())+"/index.html",mod.getId(),mod.getName()); } printTableEnd(pw); @@ -202,16 +202,16 @@ public class EldDocHtmlWriter { } } - public void writeOverviewNamespace(File basePath,ElementLanguage context) throws IOException { + public void writeOverviewNamespace(File basePath,X4OLanguageContext context) throws IOException { PrintWriter pw = createPrintWriter(basePath,"namespace-overview.html"); String pathPrefix = ""; try { String title = context.getLanguage().getLanguageName()+" "+context.getLanguage().getLanguageVersion()+" ELD"; printHeader(pw,"Overview Namespace("+title+")",pathPrefix); printPageIndexTitle(pw,title,null,null); - List mods = context.getLanguage().getElementLanguageModules(); + List mods = context.getLanguage().getLanguageModules(); Collections.sort(mods,new ElementLanguageModuleComparator()); - for (ElementLanguageModule mod:mods) { + for (X4OLanguageModule mod:mods) { printNamespaces(pw,mod.getElementNamespaceContexts(),pathPrefix,mod); } printBottom(pw,pathPrefix); @@ -222,7 +222,7 @@ public class EldDocHtmlWriter { } } - public void writeOverviewTree(File basePath,ElementLanguage context) throws IOException { + public void writeOverviewTree(File basePath,X4OLanguageContext context) throws IOException { PrintWriter pw = createPrintWriter(basePath,"tree-overview.html"); String pathPrefix = ""; try { @@ -231,7 +231,7 @@ public class EldDocHtmlWriter { printPageIndexTitle(pw,title,null,null); List rootNodes = new ArrayList(3); - for (ElementLanguageModule mod:context.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { if (ns.getLanguageRoot()!=null && ns.getLanguageRoot()) { // found language root elements. @@ -260,8 +260,8 @@ public class EldDocHtmlWriter { } class TreeNode { - ElementLanguage context; - ElementLanguageModule module; + X4OLanguageContext context; + X4OLanguageModule module; ElementNamespaceContext namespace; ElementClass elementClass; TreeNode parent; @@ -298,7 +298,7 @@ public class EldDocHtmlWriter { if (node.indent>20) { return result; // hard fail limit } - for (ElementLanguageModule mod:node.context.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:node.context.getLanguage().getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { for (ElementClass ec:ns.getElementClasses()) { TreeNode n=null; @@ -370,7 +370,7 @@ public class EldDocHtmlWriter { private List findParents(TreeNode node) { List result = new ArrayList(10); TreeNode n=null; - for (ElementLanguageModule mod:node.context.getLanguage().getElementLanguageModules()) { + for (X4OLanguageModule mod:node.context.getLanguage().getLanguageModules()) { for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { List tags = node.elementClass.getElementParents(ns.getUri()); @@ -434,7 +434,7 @@ public class EldDocHtmlWriter { } - public void writeOverviewModule(File basePath,ElementLanguageModule mod) throws IOException { + public void writeOverviewModule(File basePath,X4OLanguageModule mod) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"index.html"); String pathPrefix = "../"; try { @@ -457,7 +457,7 @@ public class EldDocHtmlWriter { } } - public void writeOverviewElement(File basePath,ElementNamespaceContext ns,ElementLanguageModule mod) throws IOException { + public void writeOverviewElement(File basePath,ElementNamespaceContext ns,X4OLanguageModule mod) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),ns.getId(),"index.html"); String pathPrefix = "../../"; try { @@ -495,7 +495,7 @@ public class EldDocHtmlWriter { } - public void writeElement(File basePath,ElementClass ec,ElementNamespaceContext ns,ElementLanguageModule mod,ElementLanguage context) throws IOException { + public void writeElement(File basePath,ElementClass ec,ElementNamespaceContext ns,X4OLanguageModule mod,X4OLanguageContext context) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),ns.getId(),ec.getTag(),"index.html"); String pathPrefix = "../../../"; try { @@ -585,7 +585,7 @@ public class EldDocHtmlWriter { } } - public void writeElementInterface(File basePath,ElementInterface iface,ElementLanguageModule mod) throws IOException { + public void writeElementInterface(File basePath,ElementInterface iface,X4OLanguageModule mod) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"interface",iface.getId()+".html"); String pathPrefix = "../../"; String pathLocal = toSafeUri(iface.getId())+"/"; @@ -607,7 +607,7 @@ public class EldDocHtmlWriter { } } - public void writeElementConfigurator(File basePath,ElementConfigurator conf,ElementLanguageModule mod) throws IOException { + public void writeElementConfigurator(File basePath,ElementConfigurator conf,X4OLanguageModule mod) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"conf",conf.getId()+".html"); String pathPrefix = "../../"; try { @@ -623,7 +623,7 @@ public class EldDocHtmlWriter { } } - public void writeElementConfigurator(File basePath,ElementConfigurator conf,ElementLanguageModule mod,ElementInterface iface) throws IOException { + public void writeElementConfigurator(File basePath,ElementConfigurator conf,X4OLanguageModule mod,ElementInterface iface) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"interface",iface.getId(),"conf",conf.getId()+".html"); String pathPrefix = "../../../../"; try { @@ -639,7 +639,7 @@ public class EldDocHtmlWriter { } } - public void writeElementConfigurator(File basePath,ElementConfigurator conf,ElementLanguageModule mod,ElementNamespaceContext ns,ElementClass ec) throws IOException { + public void writeElementConfigurator(File basePath,ElementConfigurator conf,X4OLanguageModule mod,ElementNamespaceContext ns,ElementClass ec) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),ns.getId(),ec.getTag(),"conf",conf.getId()+".html"); String pathPrefix = "../../../../"; try { @@ -655,7 +655,7 @@ public class EldDocHtmlWriter { } } - public void writeBindingHandler(File basePath,ElementBindingHandler bind,ElementLanguageModule mod) throws IOException { + public void writeBindingHandler(File basePath,ElementBindingHandler bind,X4OLanguageModule mod) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"bind",bind.getId()+".html"); String pathPrefix = "../../"; try { @@ -678,7 +678,7 @@ public class EldDocHtmlWriter { } } - public void writeBindingHandler(File basePath,ElementBindingHandler bind,ElementLanguageModule mod,ElementInterface iface) throws IOException { + public void writeBindingHandler(File basePath,ElementBindingHandler bind,X4OLanguageModule mod,ElementInterface iface) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"interface",iface.getId(),"bind",bind.getId()+".html"); String pathPrefix = "../../../../"; try { @@ -699,7 +699,7 @@ public class EldDocHtmlWriter { } } - public void writeAttributeHandler(File basePath,ElementAttributeHandler attr,ElementLanguageModule mod) throws IOException { + public void writeAttributeHandler(File basePath,ElementAttributeHandler attr,X4OLanguageModule mod) throws IOException { PrintWriter pw = createPrintWriter(basePath,mod.getId(),"attr",attr.getId()+".html"); String pathPrefix = "../../"; try { @@ -812,7 +812,7 @@ public class EldDocHtmlWriter { printTableEnd(pw); } - private void printNamespaces(PrintWriter pw,List namespaces,String pathPrefix ,ElementLanguageModule mod) { + private void printNamespaces(PrintWriter pw,List namespaces,String pathPrefix ,X4OLanguageModule mod) { printTableStart(pw,"Namespaces"); for (ElementNamespaceContext ns:namespaces) { printTableRowOverview(pw,pathPrefix+toSafeUri(mod.getId())+"/"+toSafeUri(ns.getId())+"/index.html",ns.getId(),""+ns.getUri()+"
"+TAB+ns.getName()); @@ -1028,8 +1028,8 @@ public class EldDocHtmlWriter { pw.print("\t\tTree \n"); } - class ElementLanguageModuleComparator implements Comparator { - public int compare(ElementLanguageModule o1,ElementLanguageModule o2) { + class ElementLanguageModuleComparator implements Comparator { + public int compare(X4OLanguageModule o1,X4OLanguageModule o2) { return o1.getId().compareTo(o2.getId()); } } diff --git a/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/X4ODocWriterExecutor.java b/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/X4ODocWriterExecutor.java index 6d1869f..b4c59ba 100644 --- a/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/X4ODocWriterExecutor.java +++ b/x4o-elddoc/src/main/java/org/x4o/xml/eld/doc/X4ODocWriterExecutor.java @@ -30,8 +30,8 @@ import java.util.List; import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.element.ElementException; +import org.x4o.xml.lang.X4OLanguageContext; /** * X4OLanguageHtmlWriter is support class to write html documentation from the eld. @@ -89,7 +89,7 @@ public class X4ODocWriterExecutor { public void execute() throws ElementException { X4ODriver driver = X4ODriverManager.getX4ODriver(getLanguage()); - ElementLanguage context = driver.createLanguageContext(getLanguageVersion()); + X4OLanguageContext context = driver.createLanguageContext(getLanguageVersion()); // Start doc generator EldDocGenerator generator = new EldDocGenerator(context); diff --git a/x4o-meta/src/main/java/org/x4o/xml/meta/MetaLanguageSiblingLoader.java b/x4o-meta/src/main/java/org/x4o/xml/meta/MetaLanguageSiblingLoader.java index 45703b1..dfc7d07 100644 --- a/x4o-meta/src/main/java/org/x4o/xml/meta/MetaLanguageSiblingLoader.java +++ b/x4o-meta/src/main/java/org/x4o/xml/meta/MetaLanguageSiblingLoader.java @@ -23,12 +23,12 @@ package org.x4o.xml.meta; -import org.x4o.xml.core.config.X4OLanguageLoader; -import org.x4o.xml.core.config.X4OLanguageLoaderException; -import org.x4o.xml.core.config.X4OLanguageLocal; -import org.x4o.xml.element.ElementLanguageModule; -import org.x4o.xml.element.ElementLanguageModuleLoaderException; -import org.x4o.xml.element.ElementLanguageModuleLoaderSibling; +import org.x4o.xml.lang.X4OLanguageModule; +import org.x4o.xml.lang.X4OLanguageModuleLoaderException; +import org.x4o.xml.lang.X4OLanguageModuleLoaderSibling; +import org.x4o.xml.lang.X4OLanguageLoader; +import org.x4o.xml.lang.X4OLanguageLoaderException; +import org.x4o.xml.lang.X4OLanguageLocal; /** * MetaLanguageSiblingLoader loads the generic x4o meta language into defined language. @@ -36,7 +36,7 @@ import org.x4o.xml.element.ElementLanguageModuleLoaderSibling; * @author Willem Cazander * @version 1.0 Aug 7, 2012 */ -public class MetaLanguageSiblingLoader implements ElementLanguageModuleLoaderSibling { +public class MetaLanguageSiblingLoader implements X4OLanguageModuleLoaderSibling { /** Defines the identifier of the meta x4o language. */ public static final String META_LANGUAGE = "meta"; @@ -48,10 +48,10 @@ public class MetaLanguageSiblingLoader implements ElementLanguageModuleLoaderSib * Loads an ElementLanguageModule. * @param language The ElementLanguage to load for. * @param elementLanguageModule The ElementLanguageModule to load into. - * @throws ElementLanguageModuleLoaderException Is thrown when meta language could not be loaded. - * @see org.x4o.xml.element.ElementLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.element.ElementLanguageModule) + * @throws X4OLanguageModuleLoaderException Is thrown when meta language could not be loaded. + * @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.lang.X4OLanguageModule) */ - public void loadLanguageModule(X4OLanguageLocal languageLocal,ElementLanguageModule elementLanguageModule) throws ElementLanguageModuleLoaderException { + public void loadLanguageModule(X4OLanguageLocal languageLocal,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException { elementLanguageModule.setId(META_LANGUAGE); elementLanguageModule.setName(META_LANGUAGE); elementLanguageModule.setProviderName(MetaLanguageSiblingLoader.class.getSimpleName()); @@ -63,7 +63,7 @@ public class MetaLanguageSiblingLoader implements ElementLanguageModuleLoaderSib * @param elementLanguage The ElementLanguage to load for. * @param loader The x4o language loader. * @throws X4OLanguageLoaderException - * @see org.x4o.xml.element.ElementLanguageModuleLoaderSibling#loadLanguageSibling(org.x4o.xml.element.ElementLanguage, org.x4o.xml.core.config.X4OLanguageLoader) + * @see org.x4o.xml.lang.X4OLanguageModuleLoaderSibling#loadLanguageSibling(org.x4o.xml.element.ElementLanguage, org.x4o.xml.lang.X4OLanguageLoader) */ public void loadLanguageSibling(X4OLanguageLocal languageLocal,X4OLanguageLoader loader) throws X4OLanguageLoaderException { diff --git a/x4o-meta/src/main/java/org/x4o/xml/meta/lang/BeanPropertyComparator.java b/x4o-meta/src/main/java/org/x4o/xml/meta/lang/BeanPropertyComparator.java index 7bfd5ba..ea80e1a 100644 --- a/x4o-meta/src/main/java/org/x4o/xml/meta/lang/BeanPropertyComparator.java +++ b/x4o-meta/src/main/java/org/x4o/xml/meta/lang/BeanPropertyComparator.java @@ -27,7 +27,7 @@ import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; -import org.x4o.xml.impl.DefaultElementObjectPropertyValue; +import org.x4o.xml.element.DefaultElementObjectPropertyValue; /** diff --git a/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELIDAttributeHandler.java b/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELIDAttributeHandler.java index c3d9e0c..821f61f 100644 --- a/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELIDAttributeHandler.java +++ b/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELIDAttributeHandler.java @@ -54,8 +54,8 @@ public class ELIDAttributeHandler extends AbstractElementAttributeHandler { return; } if(element.getElementObject()==null) { throw new NullPointerException("Can't bind null object to el context"); } - ValueExpression ee = element.getElementLanguage().getExpressionFactory().createValueExpression(element.getElementLanguage().getELContext(),"${"+attributeValue+"}", element.getElementObject().getClass()); + ValueExpression ee = element.getElementLanguage().getExpressionLanguageFactory().createValueExpression(element.getElementLanguage().getExpressionLanguageContext(),"${"+attributeValue+"}", element.getElementObject().getClass()); Logger.getLogger(ELIDAttributeHandler.class.getName()).finer("Set Variable in ELContext: "+"${"+attributeValue+"}"+" object SET: "+element.getElementObject()); - ee.setValue(element.getElementLanguage().getELContext(), element.getElementObject()); + ee.setValue(element.getElementLanguage().getExpressionLanguageContext(), element.getElementObject()); } } diff --git a/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELReferenceElement.java b/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELReferenceElement.java index a5b6bcd..925ea3c 100644 --- a/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELReferenceElement.java +++ b/x4o-meta/src/main/java/org/x4o/xml/meta/lang/ELReferenceElement.java @@ -44,8 +44,8 @@ public class ELReferenceElement extends AbstractElement { public void doElementRun() throws ElementException { String attributeValue = getAttributes().get("el.ref"); if("".equals(attributeValue) | attributeValue==null) { throw new ElementException("Set the el.ref attribute"); } - ValueExpression ee = getElementLanguage().getExpressionFactory().createValueExpression(getElementLanguage().getELContext(),"${"+attributeValue+"}",Object.class); + ValueExpression ee = getElementLanguage().getExpressionLanguageFactory().createValueExpression(getElementLanguage().getExpressionLanguageContext(),"${"+attributeValue+"}",Object.class); Logger.getLogger(ELReferenceElement.class.getName()).finer("Get Variable in ELContext: ${"+attributeValue+"}"); - setElementObject(ee.getValue(getElementLanguage().getELContext())); + setElementObject(ee.getValue(getElementLanguage().getExpressionLanguageContext())); } } diff --git a/x4o-meta/src/test/java/org/x4o/xml/meta/ReferenceStoreTest.java b/x4o-meta/src/test/java/org/x4o/xml/meta/ReferenceStoreTest.java index 33ccefd..79f31d3 100644 --- a/x4o-meta/src/test/java/org/x4o/xml/meta/ReferenceStoreTest.java +++ b/x4o-meta/src/test/java/org/x4o/xml/meta/ReferenceStoreTest.java @@ -25,9 +25,9 @@ package org.x4o.xml.meta; import java.util.Date; -import org.x4o.xml.core.config.X4OLanguagePropertyKeys; -import org.x4o.xml.element.ElementLanguage; import org.x4o.xml.io.X4OReaderContext; +import org.x4o.xml.lang.X4OLanguageContext; +import org.x4o.xml.lang.X4OLanguagePropertyKeys; import org.x4o.xml.meta.test.MTestDriver; import junit.framework.TestCase; @@ -41,7 +41,7 @@ import junit.framework.TestCase; public class ReferenceStoreTest extends TestCase { public void testMetaGeneric() throws Exception { - ElementLanguage context = null; + X4OLanguageContext context = null; MTestDriver driver = new MTestDriver(); X4OReaderContext reader = driver.createReaderContext(); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); @@ -54,7 +54,7 @@ public class ReferenceStoreTest extends TestCase { } public void testLoadClass() throws Exception { - ElementLanguage context = null; + X4OLanguageContext context = null; MTestDriver driver = new MTestDriver(); X4OReaderContext reader = driver.createReaderContext(); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); @@ -67,7 +67,7 @@ public class ReferenceStoreTest extends TestCase { } public void testStoreRef() throws Exception { - ElementLanguage context = null; + X4OLanguageContext context = null; MTestDriver driver = new MTestDriver(); X4OReaderContext reader = driver.createReaderContext(); reader.setProperty(X4OLanguagePropertyKeys.PHASE_SKIP_RELEASE, true); diff --git a/x4o-meta/src/test/java/org/x4o/xml/meta/test/MTestDriver.java b/x4o-meta/src/test/java/org/x4o/xml/meta/test/MTestDriver.java index 2405774..a58f940 100644 --- a/x4o-meta/src/test/java/org/x4o/xml/meta/test/MTestDriver.java +++ b/x4o-meta/src/test/java/org/x4o/xml/meta/test/MTestDriver.java @@ -25,12 +25,12 @@ package org.x4o.xml.meta.test; import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.core.config.DefaultX4OLanguage; -import org.x4o.xml.core.config.DefaultX4OLanguageConfiguration; -import org.x4o.xml.core.config.X4OLanguage; -import org.x4o.xml.core.phase.X4OPhaseManagerFactory; import org.x4o.xml.io.X4OReaderContext; import org.x4o.xml.io.X4OWriterContext; +import org.x4o.xml.lang.DefaultX4OLanguage; +import org.x4o.xml.lang.DefaultX4OLanguageConfiguration; +import org.x4o.xml.lang.X4OLanguage; +import org.x4o.xml.lang.phase.X4OPhaseManagerFactory; public class MTestDriver extends X4ODriver {