Renamed ElementNamespaceContext to ElementNamespace.

This commit is contained in:
Willem Cazander 2013-08-24 18:35:53 +02:00
parent df1f1fb959
commit b1193b9051
34 changed files with 189 additions and 204 deletions

View file

@ -35,13 +35,13 @@ import org.x4o.xml.eld.lang.ElementClassAttributeBindingHandler;
import org.x4o.xml.eld.lang.ElementClassBindingHandler;
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.ElementNamespaceBindingHandler;
import org.x4o.xml.eld.lang.ModuleElement;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceInstanceProvider;
import org.x4o.xml.element.ElementNamespaceInstanceProviderException;
@ -96,15 +96,15 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
addBindingHandler(languageModule,new ElementModuleBindingHandler(),"cel-module-bind","Binds the LanguageModule childeren.");
addBindingHandler(languageModule,new ElementClassAttributeBindingHandler(),"cel-class-attr-bind","Binds the ElementClassAttribute childeren.");
addBindingHandler(languageModule,new ElementInterfaceBindingHandler(),"cel-interface-bind","Binds the ElementInterface childeren.");
addBindingHandler(languageModule,new ElementNamespaceContextBindingHandler(),"cel-namespace-bind","Binds the Namespace childeren.");
addBindingHandler(languageModule,new ElementNamespaceBindingHandler(),"cel-namespace-bind","Binds the Namespace childeren.");
// Create cel-lang namespace in language
ElementNamespaceContext namespace = createNamespaceContext(language,CEL_CORE,CEL_CORE_URI,CEL_CORE_XSD_URI,CEL_CORE_XSD_FILE,CEL_CORE);
ElementNamespace namespace = createNamespaceContext(language,CEL_CORE,CEL_CORE_URI,CEL_CORE_XSD_URI,CEL_CORE_XSD_FILE,CEL_CORE);
configElementClasses(language,namespace);
startAndAddNamespace(language,languageModule,namespace);
// Create cel-root namespace in language for schema support
ElementNamespaceContext namespaceRoot = createNamespaceContext(language,CEL_ROOT,CEL_ROOT_URI,CEL_ROOT_XSD_URI,CEL_ROOT_XSD_FILE,CEL_ROOT);
ElementNamespace namespaceRoot = createNamespaceContext(language,CEL_ROOT,CEL_ROOT_URI,CEL_ROOT_XSD_URI,CEL_ROOT_XSD_FILE,CEL_ROOT);
namespaceRoot.setLanguageRoot(true); // Only define single language root so xsd is (mostly) not cicle import.
ElementClass rootElement = createElementClass(language,"module",language.getLanguageConfiguration().getDefaultElementLanguageModule(),ModuleElement.class,"The module tag is the root xml element for ELD language.");
rootElement.addElementClassAttribute(createElementClassAttribute(language,"id",true,null));
@ -119,7 +119,7 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
* @param language The language to config for.
* @throws X4OLanguageModuleLoaderException
*/
private void configElementClasses(X4OLanguage language,ElementNamespaceContext namespace) throws X4OLanguageModuleLoaderException {
private void configElementClasses(X4OLanguage language,ElementNamespace namespace) throws X4OLanguageModuleLoaderException {
ElementClass ec = null;
namespace.addElementClass(createElementClass(language,"attribute",language.getLanguageConfiguration().getDefaultElementClassAttribute(),null,"Defines xml element attribute."));
@ -131,7 +131,7 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
namespace.addElementClass(createElementClass(language,"classConverter",ClassConverter.class,null,"Converts string attribute to java class instance."));
ec = createElementClass(language,"namespace",language.getLanguageConfiguration().getDefaultElementNamespaceContext(),null,"Defines an xml namespace.");
ec = createElementClass(language,"namespace",language.getLanguageConfiguration().getDefaultElementNamespace(),null,"Defines an xml namespace.");
ec.addElementClassAttribute(createElementClassAttribute(language,"uri",true,null));
namespace.addElementClass(ec);
@ -197,20 +197,20 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
languageModule.setSourceResource(this.getClass().getSimpleName()); //TODO: check if oke.
}
private void startAndAddNamespace(X4OLanguageLocal language,X4OLanguageModule languageModule,ElementNamespaceContext namespace) throws X4OLanguageModuleLoaderException {
private void startAndAddNamespace(X4OLanguageLocal language,X4OLanguageModule languageModule,ElementNamespace namespace) throws X4OLanguageModuleLoaderException {
try {
namespace.getElementNamespaceInstanceProvider().start(language, namespace);
} catch (ElementNamespaceInstanceProviderException e) {
throw new X4OLanguageModuleLoaderException(this,"Error starting instance provider: "+e.getMessage(),e);
}
languageModule.addElementNamespaceContext(namespace);
languageModule.addElementNamespace(namespace);
}
private ElementNamespaceContext createNamespaceContext(X4OLanguageLocal language,String id,String uri,String schemaUri,String schemaResource,String schemaPrefix) throws X4OLanguageModuleLoaderException {
private ElementNamespace createNamespaceContext(X4OLanguageLocal language,String id,String uri,String schemaUri,String schemaResource,String schemaPrefix) throws X4OLanguageModuleLoaderException {
logger.finer("Creating "+language.getLanguageName()+" namespace.");
ElementNamespaceContext namespace;
ElementNamespace namespace;
try {
namespace = (ElementNamespaceContext)X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementNamespaceContext());
namespace = (ElementNamespace)X4OLanguageClassLoader.newInstance(language.getLanguageConfiguration().getDefaultElementNamespace());
} catch (InstantiationException e) {
throw new X4OLanguageModuleLoaderException(this,e.getMessage(),e);
} catch (IllegalAccessException e) {

View file

@ -30,7 +30,7 @@ import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementBindingHandlerException;
import org.x4o.xml.element.ElementConfiguratorGlobal;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceInstanceProvider;
import org.x4o.xml.element.ElementNamespaceInstanceProviderException;
import org.x4o.xml.lang.X4OLanguageModule;
@ -49,7 +49,7 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler<
private final static Class<?>[] CLASSES_CHILD = new Class[] {
ElementInterface.class,
ElementNamespaceContext.class,
ElementNamespace.class,
ElementBindingHandler.class,
ElementAttributeHandler.class,
ElementConfiguratorGlobal.class,
@ -88,62 +88,62 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler<
languageModule.addElementInterface(elementInterface);
return;
}
if (childObject instanceof ElementNamespaceContext) {
ElementNamespaceContext elementNamespaceContext = (ElementNamespaceContext)childObject;
if (childObject instanceof ElementNamespace) {
ElementNamespace elementNamespace = (ElementNamespace)childObject;
if (elementNamespaceContext.getId()==null) {
throw new NullPointerException("Can add ElementNamespaceContext without id.");
if (elementNamespace.getId()==null) {
throw new NullPointerException("Can add elementNamespace without id.");
}
// TODO: no language here so move to EL default on eld attribute tag
if (elementNamespaceContext.getId()!=null) {
if (elementNamespace.getId()!=null) {
StringBuffer buf = new StringBuffer(30);
for (char c:elementNamespaceContext.getId().toLowerCase().toCharArray()) {
for (char c:elementNamespace.getId().toLowerCase().toCharArray()) {
if (Character.isLetter(c)) {buf.append(c);}
if (Character.isDigit(c)) {buf.append(c);}
if ('-'==c) {buf.append(c);}
}
String id = buf.toString();
elementNamespaceContext.setId(id);
elementNamespace.setId(id);
}
if (elementNamespaceContext.getUri()==null) {
elementNamespaceContext.setUri(
if (elementNamespace.getUri()==null) {
elementNamespace.setUri(
"http://"+languageModule.getProviderHost()+
"/xml/ns/"+x4oParsingContext.getLanguageName()+
"-"+elementNamespaceContext.getId());
"-"+elementNamespace.getId());
}
if (elementNamespaceContext.getSchemaUri()==null) {
elementNamespaceContext.setSchemaUri(
if (elementNamespace.getSchemaUri()==null) {
elementNamespace.setSchemaUri(
"http://"+languageModule.getProviderHost()+
"/xml/ns/"+x4oParsingContext.getLanguageName()+
"-"+elementNamespaceContext.getId()+
"-"+elementNamespace.getId()+
"-"+x4oParsingContext.getLanguageVersion()+
".xsd"
);
}
if (elementNamespaceContext.getSchemaResource()==null) {
elementNamespaceContext.setSchemaResource(
if (elementNamespace.getSchemaResource()==null) {
elementNamespace.setSchemaResource(
x4oParsingContext.getLanguageName()+
"-"+elementNamespaceContext.getId()+
"-"+elementNamespace.getId()+
"-"+x4oParsingContext.getLanguageVersion()+
".xsd"
);
}
if (elementNamespaceContext.getSchemaPrefix()==null) {
elementNamespaceContext.setSchemaPrefix(elementNamespaceContext.getId());
if (elementNamespace.getSchemaPrefix()==null) {
elementNamespace.setSchemaPrefix(elementNamespace.getId());
}
try {
elementNamespaceContext.setElementNamespaceInstanceProvider((ElementNamespaceInstanceProvider)X4OLanguageClassLoader.newInstance(childElement.getLanguageContext().getLanguage().getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider()));
elementNamespace.setElementNamespaceInstanceProvider((ElementNamespaceInstanceProvider)X4OLanguageClassLoader.newInstance(childElement.getLanguageContext().getLanguage().getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider()));
} catch (Exception e) {
throw new ElementBindingHandlerException("Error loading: "+e.getMessage(),e);
}
try {
elementNamespaceContext.getElementNamespaceInstanceProvider().start(x4oParsingContext, elementNamespaceContext);
elementNamespace.getElementNamespaceInstanceProvider().start(x4oParsingContext, elementNamespace);
} catch (ElementNamespaceInstanceProviderException e) {
throw new ElementBindingHandlerException("Error starting: "+e.getMessage(),e);
}
languageModule.addElementNamespaceContext(elementNamespaceContext);
languageModule.addElementNamespace(elementNamespace);
return;
}
if (childObject instanceof ElementBindingHandler) {
@ -170,7 +170,7 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler<
for (ElementInterface child:parent.getElementInterfaces()) {
createChild(parentElement, child);
}
for (ElementNamespaceContext child:parent.getElementNamespaceContexts()) {
for (ElementNamespace child:parent.getElementNamespaces()) {
createChild(parentElement, child);
}
for (ElementBindingHandler child:parent.getElementBindingHandlers()) {

View file

@ -26,15 +26,15 @@ import org.x4o.xml.element.AbstractElementBindingHandler;
import org.x4o.xml.element.Element;
import org.x4o.xml.element.ElementBindingHandlerException;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
/**
* ElementNamespaceContextBindingHandler binds ElementClass into namespace.
* ElementNamespaceBindingHandler binds ElementClass into namespace.
*
* @author Willem Cazander
* @version 1.0 Aug 21, 2012
*/
public class ElementNamespaceContextBindingHandler extends AbstractElementBindingHandler<ElementNamespaceContext> {
public class ElementNamespaceBindingHandler extends AbstractElementBindingHandler<ElementNamespace> {
private final static Class<?>[] CLASSES_CHILD = new Class[] {
ElementClass.class
@ -44,7 +44,7 @@ public class ElementNamespaceContextBindingHandler extends AbstractElementBindin
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()
*/
public Class<?> getBindParentClass() {
return ElementNamespaceContext.class;
return ElementNamespace.class;
}
/**
@ -57,7 +57,7 @@ public class ElementNamespaceContextBindingHandler extends AbstractElementBindin
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,ElementNamespaceContext parent, Object childObject) throws ElementBindingHandlerException {
public void bindChild(Element childElement,ElementNamespace parent, Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof ElementClass) {
ElementClass elementClass = (ElementClass)childObject;
if (elementClass.getId()==null && elementClass.getObjectClass()!=null) {
@ -70,7 +70,7 @@ public class ElementNamespaceContextBindingHandler extends AbstractElementBindin
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
public void createChilderen(Element parentElement,ElementNamespaceContext parent) throws ElementBindingHandlerException {
public void createChilderen(Element parentElement,ElementNamespace parent) throws ElementBindingHandlerException {
for (ElementClass child:parent.getElementClasses()) {
createChild(parentElement, child);
}

View file

@ -29,7 +29,7 @@ import java.io.Writer;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementException;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.io.DefaultX4OSchemaWriter;
import org.x4o.xml.io.sax.ext.ContentWriterXml;
import org.x4o.xml.io.sax.ext.ContentWriterXsd;
@ -54,7 +54,7 @@ public class EldXsdXmlGenerator {
this.propertyConfig=propertyConfig;
}
private void checkNamespace(ElementNamespaceContext ns) {
private void checkNamespace(ElementNamespace ns) {
if (ns.getSchemaResource()==null) {
throw new NullPointerException("Can't generate xsd for namespace without schemaResource uri: "+ns.getUri());
}
@ -73,7 +73,7 @@ public class EldXsdXmlGenerator {
if (namespace!=null) {
ElementNamespaceContext ns = language.findElementNamespaceContext(namespace);
ElementNamespace ns = language.findElementNamespace(namespace);
if (ns==null) {
throw new NullPointerException("Could not find namespace: "+namespace);
}
@ -90,7 +90,7 @@ public class EldXsdXmlGenerator {
return;
}
for (X4OLanguageModule mod:language.getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
checkNamespace(ns);
File outputFile = new File(basePath.getAbsolutePath()+File.separatorChar+ns.getSchemaResource());
Writer wr = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
@ -111,7 +111,7 @@ public class EldXsdXmlGenerator {
public void generateSchema(String namespaceUri,ContentWriterXsd xmlWriter) throws SAXException {
ElementNamespaceContext ns = language.findElementNamespaceContext(namespaceUri);
ElementNamespace ns = language.findElementNamespace(namespaceUri);
if (ns==null) {
throw new NullPointerException("Could not find namespace: "+namespaceUri);
}

View file

@ -38,7 +38,7 @@ import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementMetaBase;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.io.XMLConstants;
import org.x4o.xml.io.sax.ext.ContentWriterXsd;
import org.x4o.xml.lang.X4OLanguageModule;
@ -112,13 +112,13 @@ public class EldXsdXmlWriter {
// redo this mess, add nice find for binding handlers
for (X4OLanguageModule modContext:language.getLanguageModules()) {
for (ElementNamespaceContext nsContext:modContext.getElementNamespaceContexts()) {
for (ElementNamespace nsContext:modContext.getElementNamespaces()) {
for (ElementClass ec:nsContext.getElementClasses()) {
Class<?> objectClass = null;
if (ec.getObjectClass()!=null) {
objectClass = ec.getObjectClass();
for (X4OLanguageModule mod:language.getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
for (ElementClass checkClass:ns.getElementClasses()) {
if (checkClass.getObjectClass()==null) {
continue;
@ -147,7 +147,7 @@ public class EldXsdXmlWriter {
private static final String COMMENT_SEPERATOR = " ==================================================================== ";
private static final String COMMENT_TEXT = "=====";
public void startSchema(ElementNamespaceContext ns) throws SAXException {
public void startSchema(ElementNamespace ns) throws SAXException {
xmlWriter.startDocument();
xmlWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
@ -174,7 +174,7 @@ public class EldXsdXmlWriter {
X4OLanguageModule module = null;
for (X4OLanguageModule elm:language.getLanguageModules()) {
ElementNamespaceContext s = elm.getElementNamespaceContext(ns.getUri());
ElementNamespace s = elm.getElementNamespace(ns.getUri());
if (s!=null) {
module = elm;
break;
@ -185,7 +185,7 @@ public class EldXsdXmlWriter {
b.append("\n\tID:\t\t"); b.append(module.getId());
b.append("\n\tProviderName:\t"); b.append(module.getProviderName());
b.append("\n\tProviderHost:\t"); b.append(module.getProviderHost());
b.append("\n\tNamespaces:\t\t"); b.append(module.getElementNamespaceContexts().size());
b.append("\n\tNamespaces:\t\t"); b.append(module.getElementNamespaces().size());
b.append("\n\tUri:\t\t\t"); b.append(ns.getUri());
b.append("\n\tUri schema:\t"); b.append(ns.getSchemaUri());
b.append("\n\tCreated on:\t\t"); b.append(new Date());
@ -211,7 +211,7 @@ public class EldXsdXmlWriter {
if (ns.getUri().equals(uri)) {
continue;
}
ElementNamespaceContext nsContext = language.findElementNamespaceContext(uri);
ElementNamespace nsContext = language.findElementNamespace(uri);
atts = new AttributesImpl();
atts.addAttribute ("", "namespace", "", "", nsContext.getUri());
atts.addAttribute ("", "schemaLocation", "", "", nsContext.getSchemaResource());
@ -226,7 +226,7 @@ public class EldXsdXmlWriter {
xmlWriter.endDocument();
}
public void writeElementClass(ElementClass ec,ElementNamespaceContext nsWrite) throws SAXException {
public void writeElementClass(ElementClass ec,ElementNamespace nsWrite) throws SAXException {
AttributesImpl atts = new AttributesImpl();
if (nsWrite.getLanguageRoot()!=null && nsWrite.getLanguageRoot()) {
@ -262,7 +262,7 @@ public class EldXsdXmlWriter {
xmlWriter.startElement (SCHEMA_URI, "choice", "", atts);
for (X4OLanguageModule mod:language.getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
writeElementClassNamespaces(ec,nsWrite,ns);
}
}
@ -362,7 +362,7 @@ public class EldXsdXmlWriter {
}
}
private void writeElementClassNamespaces(ElementClass ecWrite,ElementNamespaceContext nsWrite,ElementNamespaceContext ns) throws SAXException {
private void writeElementClassNamespaces(ElementClass ecWrite,ElementNamespace nsWrite,ElementNamespace ns) throws SAXException {
AttributesImpl atts = new AttributesImpl();
List<String> refElements = new ArrayList<String>(20);
for (ElementClass checkClass:ns.getElementClasses()) {
@ -417,7 +417,7 @@ public class EldXsdXmlWriter {
}
public void writeElement(ElementClass ec,ElementNamespaceContext nsWrite) throws SAXException {
public void writeElement(ElementClass ec,ElementNamespace nsWrite) throws SAXException {
if (nsWrite.getLanguageRoot()!=null && nsWrite.getLanguageRoot()) {
return; // is done in writeElementClass
}

View file

@ -28,11 +28,12 @@ import java.util.List;
import java.util.Map;
/**
* The abstract verion of ElementNamespaceContext
* AbstractElementNamespace is the abstract version of an ElementNamespace.
*
* @author Willem Cazander
* @version 1.0 Oct 28, 2009
*/
public abstract class AbstractElementNamespaceContext extends AbstractElementMetaBase implements ElementNamespaceContext {
public abstract class AbstractElementNamespace extends AbstractElementMetaBase implements ElementNamespace {
private ElementNamespaceInstanceProvider elementNamespaceInstanceProvider = null;
private String prefixMapping = null;
@ -44,12 +45,12 @@ public abstract class AbstractElementNamespaceContext extends AbstractElementMet
private String schemaPrefix = null;
private Boolean languageRoot = null;
public AbstractElementNamespaceContext() {
public AbstractElementNamespace() {
elementClasses = new HashMap<String,ElementClass>(100);
}
/**
* @see org.x4o.xml.element.ElementNamespaceContext#getPrefixMapping()
* @see org.x4o.xml.element.ElementNamespace#getPrefixMapping()
*/
public String getPrefixMapping() {
return prefixMapping;
@ -70,14 +71,14 @@ public abstract class AbstractElementNamespaceContext extends AbstractElementMet
}
/**
* @see org.x4o.xml.element.ElementNamespaceContext#setPrefixMapping(java.lang.String)
* @see org.x4o.xml.element.ElementNamespace#setPrefixMapping(java.lang.String)
*/
public void setPrefixMapping(String prefixMapping) {
this.prefixMapping=prefixMapping;
}
/**
* @see org.x4o.xml.element.ElementNamespaceContext#addElementClass(org.x4o.xml.element.ElementClass)
* @see org.x4o.xml.element.ElementNamespace#addElementClass(org.x4o.xml.element.ElementClass)
*/
public void addElementClass(ElementClass elementClass) {
if (elementClass.getId()==null) {
@ -87,14 +88,14 @@ public abstract class AbstractElementNamespaceContext extends AbstractElementMet
}
/**
* @see org.x4o.xml.element.ElementNamespaceContext#getElementClass(java.lang.String)
* @see org.x4o.xml.element.ElementNamespace#getElementClass(java.lang.String)
*/
public ElementClass getElementClass(String tag) {
return elementClasses.get(tag);
}
/**
* @see org.x4o.xml.element.ElementNamespaceContext#getElementClasses()
* @see org.x4o.xml.element.ElementNamespace#getElementClasses()
*/
public List<ElementClass> getElementClasses() {
return new ArrayList<ElementClass>(elementClasses.values());

View file

@ -24,11 +24,11 @@ package org.x4o.xml.element;
/**
* The default namespace context.
* DefaultElementNamespace is the default element namespace implementation.
*
* @author Willem Cazander
* @version 1.0 Oct 28, 2009
*/
public class DefaultElementNamespaceContext extends AbstractElementNamespaceContext {
public class DefaultElementNamespace extends AbstractElementNamespace {
}

View file

@ -37,7 +37,7 @@ import org.x4o.xml.lang.X4OLanguageClassLoader;
public class DefaultElementNamespaceInstanceProvider implements ElementNamespaceInstanceProvider {
private Logger logger = null;
private ElementNamespaceContext elementNamespaceContext = null;
private ElementNamespace elementNamespace = null;
/**
* Creates new DefaultElementNamespaceInstanceProvider.
@ -48,12 +48,12 @@ 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.lang.X4OLanguage, org.x4o.xml.element.ElementNamespaceContext)
* @param elementNamespace The elementNamespace for this provider.
* @see org.x4o.xml.element.ElementNamespaceInstanceProvider#start(org.x4o.xml.lang.X4OLanguage, org.x4o.xml.element.ElementNamespace)
*/
public void start(X4OLanguage language,ElementNamespaceContext elementNamespaceContext) {
this.elementNamespaceContext=elementNamespaceContext;
logger.finer("Starting DefaultElementNamespaceInstanceProvider for: "+elementNamespaceContext.getUri());
public void start(X4OLanguage language,ElementNamespace elementNamespace) {
this.elementNamespace=elementNamespace;
logger.finer("Starting DefaultElementNamespaceInstanceProvider for: "+elementNamespace.getUri());
}
/**
@ -64,11 +64,11 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace
* @see org.x4o.xml.element.ElementNamespaceInstanceProvider#createElementInstance(org.x4o.xml.lang.X4OLanguageContext,java.lang.String)
*/
public Element createElementInstance(X4OLanguageContext languageContext,String tag) throws ElementNamespaceInstanceProviderException {
ElementClass elementClass = elementNamespaceContext.getElementClass(tag);
ElementClass elementClass = elementNamespace.getElementClass(tag);
Element element = null;
if (elementClass==null) {
throw new ElementNamespaceInstanceProviderException(this,"Tag: " + tag + " unknown in: " + elementNamespaceContext.getUri());
throw new ElementNamespaceInstanceProviderException(this,"Tag: " + tag + " unknown in: " + elementNamespace.getUri());
}
try {

View file

@ -25,12 +25,12 @@ package org.x4o.xml.element;
import java.util.List;
/**
* ElementNamespaceContext stores all element tag classes for the namespace.
* ElementNamespace stores all element tag classes for the namespace.
*
* @author Willem Cazander
* @version 1.0 Oct 28, 2009
*/
public interface ElementNamespaceContext extends ElementMetaBase {
public interface ElementNamespace extends ElementMetaBase {
/**
* Sets the prefix mapping.

View file

@ -36,10 +36,10 @@ public interface ElementNamespaceInstanceProvider {
/**
* Starts the ElementProvider.
* @param language The X4OLanguage to start in.
* @param elementNamespaceContext The ElementNamespaceContext to start for.
* @param elementNamespace The elementNamespace to start for.
* @throws ElementNamespaceInstanceProviderException Thrown when error happened in language.
*/
void start(X4OLanguage language,ElementNamespaceContext elementNamespaceContext) throws ElementNamespaceInstanceProviderException;
void start(X4OLanguage language,ElementNamespace elementNamespace) throws ElementNamespaceInstanceProviderException;
/**
* Provide an Element for an xml tag.

View file

@ -37,7 +37,7 @@ import org.x4o.xml.element.Element;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementObjectPropertyValueException;
import org.x4o.xml.io.sax.ext.PropertyConfig;
import org.x4o.xml.io.sax.ext.ContentWriterXml;
@ -128,7 +128,7 @@ public class DefaultX4OWriter<T> extends AbstractX4OWriter<T> {
Element root = languageContext.getRootElement();
if (schemaUriRoot==null) {
String rootUri = findElementUri(root);
ElementNamespaceContext ns = languageContext.getLanguage().findElementNamespaceContext(rootUri);
ElementNamespace ns = languageContext.getLanguage().findElementNamespace(rootUri);
if (ns!=null) {
schemaUriRoot = ns.getSchemaUri();
}
@ -316,7 +316,7 @@ public class DefaultX4OWriter<T> extends AbstractX4OWriter<T> {
private String findElementUri(Element e) {
for (X4OLanguageModule mod:e.getLanguageContext().getLanguage().getLanguageModules()) {
for (ElementNamespaceContext c:mod.getElementNamespaceContexts()) {
for (ElementNamespace c:mod.getElementNamespaces()) {
ElementClass ec = c.getElementClass(e.getElementClass().getId());
if (ec!=null) {
return c.getUri();
@ -327,7 +327,7 @@ public class DefaultX4OWriter<T> extends AbstractX4OWriter<T> {
}
private String findNamespacePrefix(Element e,String uri) {
ElementNamespaceContext ns = e.getLanguageContext().getLanguage().findElementNamespaceContext(uri);
ElementNamespace ns = e.getLanguageContext().getLanguage().findElementNamespace(uri);
if (ns.getPrefixMapping()!=null) {
return ns.getPrefixMapping();
}

View file

@ -25,7 +25,7 @@ package org.x4o.xml.io.sax;
import org.x4o.xml.element.Element;
import org.x4o.xml.element.Element.ElementType;
import org.x4o.xml.element.ElementException;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceInstanceProvider;
import org.x4o.xml.io.DefaultX4OReader;
import org.x4o.xml.io.sax.ext.AttributeMap;
@ -106,7 +106,7 @@ public class X4OContentHandler extends DefaultHandler2 {
if ("http://www.w3.org/2001/XInclude".equals(namespaceUri)) {
return; // skip xinclude ns.
}
ElementNamespaceContext enc = elementLanguage.getLanguage().findElementNamespaceContext(namespaceUri);
ElementNamespace enc = elementLanguage.getLanguage().findElementNamespace(namespaceUri);
if (enc==null) {
throw new SAXException("Can't find namespace uri: "+namespaceUri+" in language: "+elementLanguage.getLanguage().getLanguageName());
}
@ -125,16 +125,16 @@ public class X4OContentHandler extends DefaultHandler2 {
overrideSaxHandler.startElement(namespaceUri, tag, qName, attributes);
return;
}
ElementNamespaceContext enc = elementLanguage.getLanguage().findElementNamespaceContext(namespaceUri);
ElementNamespace enc = elementLanguage.getLanguage().findElementNamespace(namespaceUri);
if (enc==null) {
if ("".equals(namespaceUri)) {
String configEmptryUri = propertyConfig.getPropertyString(DefaultX4OReader.DOC_EMPTY_NAMESPACE_URI);
if (configEmptryUri!=null) {
namespaceUri = configEmptryUri;
enc = elementLanguage.getLanguage().findElementNamespaceContext(namespaceUri);
enc = elementLanguage.getLanguage().findElementNamespace(namespaceUri);
}
if (enc==null) {
throw new SAXParseException("No ElementNamespaceContext found for empty namespace.",locator);
throw new SAXParseException("No ElementNamespace found for empty namespace.",locator);
}
enc.setPrefixMapping("");
}

View file

@ -38,7 +38,7 @@ import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementConfiguratorGlobal;
import org.x4o.xml.element.ElementException;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceInstanceProvider;
import org.x4o.xml.io.sax.ext.ContentWriter;
import org.x4o.xml.lang.X4OLanguageModule;
@ -142,7 +142,7 @@ public class X4ODebugWriter {
contentWriter.startElement (DEBUG_URI, "X4OLanguageDefaultClasses", "", atts);
X4OLanguageConfiguration conf = ec.getLanguage().getLanguageConfiguration();
debugLanguageDefaultClass("getDefaultElementNamespaceContext",conf.getDefaultElementNamespaceContext());
debugLanguageDefaultClass("getDefaultElementNamespace",conf.getDefaultElementNamespace());
debugLanguageDefaultClass("getDefaultElementInterface",conf.getDefaultElementInterface());
debugLanguageDefaultClass("getDefaultElement",conf.getDefaultElement());
debugLanguageDefaultClass("getDefaultElementClass",conf.getDefaultElementClass());
@ -234,7 +234,7 @@ public class X4ODebugWriter {
//module.getElementBindingHandlers();
//module.getGlobalElementConfigurators();
//module.getElementInterfaces();
//module.getElementNamespaceContexts();
//module.getElementNamespace();
debugElementConfiguratorGlobal(module.getElementConfiguratorGlobals());
debugElementBindingHandler(module.getElementBindingHandlers());
@ -265,7 +265,7 @@ public class X4ODebugWriter {
contentWriter.endElement(DEBUG_URI, "elementInterface", "");
}
for (ElementNamespaceContext enc:module.getElementNamespaceContexts()) {
for (ElementNamespace enc:module.getElementNamespaces()) {
atts = new AttributesImpl();
atts.addAttribute ("", "uri", "", "", enc.getUri());
atts.addAttribute ("", "description", "", "", enc.getDescription());
@ -273,7 +273,7 @@ public class X4ODebugWriter {
atts.addAttribute ("", "schemaResource", "", "", enc.getSchemaResource());
atts.addAttribute ("", "className", "", "", enc.getClass().getName());
contentWriter.startElement (DEBUG_URI, ElementNamespaceContext.class.getSimpleName(), "", atts);
contentWriter.startElement (DEBUG_URI, ElementNamespace.class.getSimpleName(), "", atts);
for (ElementClass ec:enc.getElementClasses()) {
debugElementClass(ec);
}
@ -284,7 +284,7 @@ public class X4ODebugWriter {
contentWriter.startElement (DEBUG_URI, ElementNamespaceInstanceProvider.class.getSimpleName(), "", atts);
contentWriter.endElement(DEBUG_URI, ElementNamespaceInstanceProvider.class.getSimpleName(), "");
contentWriter.endElement(DEBUG_URI, ElementNamespaceContext.class.getSimpleName(), "");
contentWriter.endElement(DEBUG_URI, ElementNamespace.class.getSimpleName(), "");
}
contentWriter.endElement(DEBUG_URI, "ElementLanguageModule", "");

View file

@ -30,7 +30,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.io.DefaultX4OReader;
import org.x4o.xml.io.sax.ext.PropertyConfig;
import org.x4o.xml.lang.X4OLanguageModule;
@ -74,7 +74,7 @@ public class X4OEntityResolver implements EntityResolver {
this.schemaResources=new HashMap<String,String>(20);
this.schemaPathResources=new HashMap<String,String>(20);
for (X4OLanguageModule mod:elementContext.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
if (ns.getSchemaUri()==null) {
continue;
}

View file

@ -22,10 +22,6 @@
*/
package org.x4o.xml.lang;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* AbstractX4OLanguageConfiguration.
*
@ -37,7 +33,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
private String languageResourcePathPrefix = null;
private String languageResourceModulesFileName = null;
private Class<?> defaultElementNamespaceContext = null;
private Class<?> defaultElementNamespace = null;
private Class<?> defaultElementInterface = null;
private Class<?> defaultElement = null;
private Class<?> defaultElementClass = null;
@ -86,24 +82,22 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param languageResourceModulesFileName the languageResourceModulesFileName to set
*/
public void setLanguageResourceModulesFileName(
String languageResourceModulesFileName) {
public void setLanguageResourceModulesFileName(String languageResourceModulesFileName) {
this.languageResourceModulesFileName = languageResourceModulesFileName;
}
/**
* @return the defaultElementNamespaceContext
* @return the defaultElementNamespace
*/
public Class<?> getDefaultElementNamespaceContext() {
return defaultElementNamespaceContext;
public Class<?> getDefaultElementNamespace() {
return defaultElementNamespace;
}
/**
* @param defaultElementNamespaceContext the defaultElementNamespaceContext to set
* @param defaultElementNamespace the defaultElementNamespace to set
*/
public void setDefaultElementNamespaceContext(
Class<?> defaultElementNamespaceContext) {
this.defaultElementNamespaceContext = defaultElementNamespaceContext;
public void setDefaultElementNamespace(Class<?> defaultElementNamespace) {
this.defaultElementNamespace = defaultElementNamespace;
}
/**
@ -158,8 +152,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementClassAttribute the defaultElementClassAttribute to set
*/
public void setDefaultElementClassAttribute(
Class<?> defaultElementClassAttribute) {
public void setDefaultElementClassAttribute(Class<?> defaultElementClassAttribute) {
this.defaultElementClassAttribute = defaultElementClassAttribute;
}
@ -173,8 +166,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementLanguageModule the defaultElementLanguageModule to set
*/
public void setDefaultElementLanguageModule(
Class<?> defaultElementLanguageModule) {
public void setDefaultElementLanguageModule(Class<?> defaultElementLanguageModule) {
this.defaultElementLanguageModule = defaultElementLanguageModule;
}
@ -202,8 +194,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementBodyCharacters the defaultElementBodyCharacters to set
*/
public void setDefaultElementBodyCharacters(
Class<?> defaultElementBodyCharacters) {
public void setDefaultElementBodyCharacters(Class<?> defaultElementBodyCharacters) {
this.defaultElementBodyCharacters = defaultElementBodyCharacters;
}
@ -217,8 +208,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementBodyWhitespace the defaultElementBodyWhitespace to set
*/
public void setDefaultElementBodyWhitespace(
Class<?> defaultElementBodyWhitespace) {
public void setDefaultElementBodyWhitespace(Class<?> defaultElementBodyWhitespace) {
this.defaultElementBodyWhitespace = defaultElementBodyWhitespace;
}
@ -232,8 +222,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementNamespaceInstanceProvider the defaultElementNamespaceInstanceProvider to set
*/
public void setDefaultElementNamespaceInstanceProvider(
Class<?> defaultElementNamespaceInstanceProvider) {
public void setDefaultElementNamespaceInstanceProvider(Class<?> defaultElementNamespaceInstanceProvider) {
this.defaultElementNamespaceInstanceProvider = defaultElementNamespaceInstanceProvider;
}
@ -247,8 +236,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementAttributeValueParser the defaultElementAttributeValueParser to set
*/
public void setDefaultElementAttributeValueParser(
Class<?> defaultElementAttributeValueParser) {
public void setDefaultElementAttributeValueParser(Class<?> defaultElementAttributeValueParser) {
this.defaultElementAttributeValueParser = defaultElementAttributeValueParser;
}
@ -262,8 +250,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementObjectPropertyValue the defaultElementObjectPropertyValue to set
*/
public void setDefaultElementObjectPropertyValue(
Class<?> defaultElementObjectPropertyValue) {
public void setDefaultElementObjectPropertyValue(Class<?> defaultElementObjectPropertyValue) {
this.defaultElementObjectPropertyValue = defaultElementObjectPropertyValue;
}
@ -277,8 +264,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultElementAttributeHandlerComparator the defaultElementAttributeHandlerComparator to set
*/
public void setDefaultElementAttributeHandlerComparator(
Class<?> defaultElementAttributeHandlerComparator) {
public void setDefaultElementAttributeHandlerComparator(Class<?> defaultElementAttributeHandlerComparator) {
this.defaultElementAttributeHandlerComparator = defaultElementAttributeHandlerComparator;
}
@ -292,8 +278,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultLanguageVersionFilter the defaultLanguageVersionFilter to set
*/
public void setDefaultLanguageVersionFilter(
Class<?> defaultLanguageVersionFilter) {
public void setDefaultLanguageVersionFilter(Class<?> defaultLanguageVersionFilter) {
this.defaultLanguageVersionFilter = defaultLanguageVersionFilter;
}
@ -321,8 +306,7 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
/**
* @param defaultExpressionLanguageContext the defaultExpressionLanguageContext to set
*/
public void setDefaultExpressionLanguageContext(
Class<?> defaultExpressionLanguageContext) {
public void setDefaultExpressionLanguageContext(Class<?> defaultExpressionLanguageContext) {
this.defaultExpressionLanguageContext = defaultExpressionLanguageContext;
}
}

View file

@ -33,7 +33,7 @@ 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;
import org.x4o.xml.element.ElementNamespace;
/**
* An AbstractElementLanguageModule.
@ -52,7 +52,7 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase
private List<ElementBindingHandler> elementBindingHandlers = null;
private List<ElementConfiguratorGlobal> elementConfiguratorGlobals = null;
private List<ElementInterface> elementInterfaces = null;
private Map<String,ElementNamespaceContext> elementNamespaceContexts = null;
private Map<String,ElementNamespace> elementNamespaces = null;
private X4OLanguageModuleLoader elementLanguageModuleLoader = null;
/**
@ -65,7 +65,7 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase
elementBindingHandlers = new ArrayList<ElementBindingHandler>(4);
elementConfiguratorGlobals = new ArrayList<ElementConfiguratorGlobal>(4);
elementInterfaces = new ArrayList<ElementInterface>(20);
elementNamespaceContexts = new HashMap<String,ElementNamespaceContext>(10);
elementNamespaces = new HashMap<String,ElementNamespace>(10);
}
/**
@ -190,31 +190,31 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase
}
/**
* @see org.x4o.xml.lang.X4OLanguageModule#addElementNamespaceContext(org.x4o.xml.element.ElementNamespaceContext)
* @see org.x4o.xml.lang.X4OLanguageModule#addElementNamespace(org.x4o.xml.element.ElementNamespace)
*/
public void addElementNamespaceContext(ElementNamespaceContext elementNamespaceContext) {
if (elementNamespaceContext==null) {
public void addElementNamespace(ElementNamespace elementNamespace) {
if (elementNamespace==null) {
throw new NullPointerException("Can't add null.");
}
if (elementNamespaceContext.getUri()==null) {
throw new NullPointerException("Can add ElementNamespaceContext without uri.");
if (elementNamespace.getUri()==null) {
throw new NullPointerException("Can add ElementNamespace without uri.");
}
logger.fine("Adding namespaceUri: "+elementNamespaceContext.getUri());
elementNamespaceContexts.put(elementNamespaceContext.getUri(), elementNamespaceContext);
logger.fine("Adding namespaceUri: "+elementNamespace.getUri());
elementNamespaces.put(elementNamespace.getUri(), elementNamespace);
}
/**
* @see org.x4o.xml.lang.X4OLanguageModule#getElementNamespaceContext(java.lang.String)
* @see org.x4o.xml.lang.X4OLanguageModule#getElementNamespace(java.lang.String)
*/
public ElementNamespaceContext getElementNamespaceContext(String namespaceUri) {
return elementNamespaceContexts.get(namespaceUri);
public ElementNamespace getElementNamespace(String namespaceUri) {
return elementNamespaces.get(namespaceUri);
}
/**
* @see org.x4o.xml.lang.X4OLanguageModule#getElementNamespaceContexts()
* @see org.x4o.xml.lang.X4OLanguageModule#getElementNamespaces()
*/
public List<ElementNamespaceContext> getElementNamespaceContexts() {
return new ArrayList<ElementNamespaceContext>(elementNamespaceContexts.values());
public List<ElementNamespace> getElementNamespaces() {
return new ArrayList<ElementNamespace>(elementNamespaces.values());
}
/**
@ -252,7 +252,7 @@ public abstract class AbstractX4OLanguageModule extends AbstractElementMetaBase
elementAttributeHandlers.clear();
elementBindingHandlers.clear();
elementInterfaces.clear();
elementNamespaceContexts.clear();
elementNamespaces.clear();
getLanguageModuleLoader().loadLanguageModule(elementLanguage, elementLanguageModule);
}

View file

@ -32,7 +32,7 @@ import org.x4o.xml.element.ElementAttributeValueParser;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceInstanceProviderException;
import org.x4o.xml.element.ElementObjectPropertyValue;
import org.x4o.xml.lang.phase.X4OPhaseException;
@ -157,7 +157,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
*/
public Element createElementInstance(X4OLanguageContext context,Class<?> objectClass) {
for (X4OLanguageModule modContext:getLanguageModules()) {
for (ElementNamespaceContext nsContext:modContext.getElementNamespaceContexts()) {
for (ElementNamespace nsContext:modContext.getElementNamespaces()) {
for (ElementClass ec:nsContext.getElementClasses()) {
if (ec.getObjectClass()!=null && ec.getObjectClass().equals(objectClass)) {
try {
@ -253,15 +253,15 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguage#findElementNamespaceContext(java.lang.String)
* @see org.x4o.xml.lang.X4OLanguage#findElementNamespace(java.lang.String)
*/
public ElementNamespaceContext findElementNamespaceContext(String namespaceUri) {
public ElementNamespace findElementNamespace(String namespaceUri) {
// TODO: refactor so no search for every tag !!
ElementNamespaceContext result = null;
ElementNamespace result = null;
for (int i=0;i<elementLanguageModules.size();i++) {
X4OLanguageModule module = elementLanguageModules.get(i);
result = module.getElementNamespaceContext(namespaceUri);
result = module.getElementNamespace(namespaceUri);
if (result!=null) {
return result;
}

View file

@ -35,7 +35,7 @@ import org.x4o.xml.element.DefaultElementBodyWhitespace;
import org.x4o.xml.element.DefaultElementClass;
import org.x4o.xml.element.DefaultElementClassAttribute;
import org.x4o.xml.element.DefaultElementInterface;
import org.x4o.xml.element.DefaultElementNamespaceContext;
import org.x4o.xml.element.DefaultElementNamespace;
import org.x4o.xml.element.DefaultElementNamespaceInstanceProvider;
import org.x4o.xml.element.DefaultElementObjectPropertyValue;
import org.x4o.xml.element.DefaultGlobalAttributeHandlerComparator;
@ -57,7 +57,7 @@ public class DefaultX4OLanguageConfiguration extends AbstractX4OLanguageConfigur
public void fillDefaults() {
if (getLanguageResourcePathPrefix()==null) { setLanguageResourcePathPrefix( X4OLanguageConfiguration.DEFAULT_LANG_PATH_PREFIX); }
if (getLanguageResourceModulesFileName()==null) { setLanguageResourceModulesFileName( X4OLanguageConfiguration.DEFAULT_LANG_MODULES_FILE);}
if (getDefaultElementNamespaceContext()==null) { setDefaultElementNamespaceContext( DefaultElementNamespaceContext.class); }
if (getDefaultElementNamespace()==null) { setDefaultElementNamespace( DefaultElementNamespace.class); }
if (getDefaultElementInterface()==null) { setDefaultElementInterface( DefaultElementInterface.class); }
if (getDefaultElement()==null) { setDefaultElement( DefaultElement.class); }
if (getDefaultElementClass()==null) { setDefaultElementClass( DefaultElementClass.class); }

View file

@ -27,7 +27,7 @@ import java.util.List;
import org.x4o.xml.element.Element;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.lang.phase.X4OPhaseManager;
/**
@ -98,9 +98,9 @@ public interface X4OLanguage {
/**
* Returns the namespace context for an namespace uri.
* @param namespaceUri the namespace uri.
* @return The ElementNamespaceContext.
* @return The ElementNamespace.
*/
ElementNamespaceContext findElementNamespaceContext(String namespaceUri);
ElementNamespace findElementNamespace(String namespaceUri);
/**
* @return Returns a list of element language modules in this defined and loaded language.

View file

@ -47,7 +47,7 @@ public interface X4OLanguageConfiguration {
String getLanguageResourceModulesFileName();
// Core interfaces are also in class for text reference without instance
Class<?> getDefaultElementNamespaceContext();
Class<?> getDefaultElementNamespace();
Class<?> getDefaultElementInterface();
Class<?> getDefaultElement();
Class<?> getDefaultElementClass();

View file

@ -35,7 +35,7 @@ public interface X4OLanguageConfigurationLocal extends X4OLanguageConfiguration
void setLanguageResourcePathPrefix(String value);
void setLanguageResourceModulesFileName(String value);
void setDefaultElementNamespaceContext(Class<?> value);
void setDefaultElementNamespace(Class<?> value);
void setDefaultElementInterface(Class<?> value);
void setDefaultElement(Class<?> value);
void setDefaultElementClass(Class<?> value);

View file

@ -29,7 +29,7 @@ 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;
import org.x4o.xml.element.ElementNamespace;
/**
* The ElementLanguageModule.<br>
@ -110,21 +110,21 @@ public interface X4OLanguageModule extends ElementMetaBase {
/**
* Adds an namespace to this langauge module.
* @param elementNamespaceContext Adds an ElementNamespaceContext to this langauge module.
* @param elementNamespace Adds an ElementNamespace to this langauge module.
*/
void addElementNamespaceContext(ElementNamespaceContext elementNamespaceContext);
void addElementNamespace(ElementNamespace elementNamespace);
/**
* Returns the namespace context for an namespace uri.
* @param namespaceUri the namespace uri.
* @return The ElementNamespaceContext.
* @return The ElementNamespace.
*/
ElementNamespaceContext getElementNamespaceContext(String namespaceUri);
ElementNamespace getElementNamespace(String namespaceUri);
/**
* @return Returns a list of all namespaces defined in this language.
*/
List<ElementNamespaceContext> getElementNamespaceContexts();
List<ElementNamespace> getElementNamespaces();
/**
* @param elementLanguageModuleLoader Sets the loader of this module.

View file

@ -40,7 +40,7 @@ import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementConfiguratorGlobal;
import org.x4o.xml.element.ElementException;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.io.sax.X4ODebugWriter;
import org.x4o.xml.io.sax.ext.ContentWriter;
import org.x4o.xml.lang.X4OLanguageModule;
@ -767,7 +767,7 @@ public class X4OPhaseLanguageRead {
// note: slow version
private String getNamespaceForElement(Element e) {
for (X4OLanguageModule mod:e.getLanguageContext().getLanguage().getLanguageModules()) {
for (ElementNamespaceContext enc:mod.getElementNamespaceContexts()) {
for (ElementNamespace enc:mod.getElementNamespaces()) {
List<ElementClass> l = enc.getElementClasses();
if (l.contains(e.getElementClass())) {
return enc.getUri();
@ -802,7 +802,7 @@ public class X4OPhaseLanguageRead {
}
String nameSpace = getNamespaceForElement(element);
String prefix = element.getLanguageContext().getLanguage().findElementNamespaceContext(nameSpace).getPrefixMapping();
String prefix = element.getLanguageContext().getLanguage().findElementNamespace(nameSpace).getPrefixMapping();
if (startedPrefix.contains(prefix)==false) {
handler.startPrefixMapping(prefix, nameSpace);

View file

@ -29,7 +29,7 @@ import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementBindingHandlerException;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementException;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceInstanceProviderException;
import org.x4o.xml.lang.X4OLanguageModule;
import org.x4o.xml.lang.X4OLanguageContext;
@ -133,7 +133,7 @@ public class X4OPhaseLanguageWrite {
private Element findRootElement(X4OLanguageContext languageContext,Class<?> objectClass) throws ElementNamespaceInstanceProviderException {
// redo this mess, add nice find for root
for (X4OLanguageModule modContext:languageContext.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext nsContext:modContext.getElementNamespaceContexts()) {
for (ElementNamespace nsContext:modContext.getElementNamespaces()) {
if (nsContext.getLanguageRoot()!=null && nsContext.getLanguageRoot()) {
for (ElementClass ec:nsContext.getElementClasses()) {
if (ec.getObjectClass()!=null && ec.getObjectClass().equals(objectClass)) {
@ -144,7 +144,7 @@ public class X4OPhaseLanguageWrite {
}
}
for (X4OLanguageModule modContext:languageContext.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext nsContext:modContext.getElementNamespaceContexts()) {
for (ElementNamespace nsContext:modContext.getElementNamespaces()) {
for (ElementClass ec:nsContext.getElementClasses()) {
if (ec.getObjectClass()!=null && ec.getObjectClass().equals(objectClass)) {
return nsContext.getElementNamespaceInstanceProvider().createElementInstance(languageContext, ec.getId());

View file

@ -38,7 +38,7 @@
<bindingHandler id="ElementModuleBindingHandler" bean.class="org.x4o.xml.eld.lang.ElementModuleBindingHandler"/>
<bindingHandler id="ElementClassAttributeBindingHandler" bean.class="org.x4o.xml.eld.lang.ElementClassAttributeBindingHandler"/>
<bindingHandler id="ElementInterfaceBindingHandler" bean.class="org.x4o.xml.eld.lang.ElementInterfaceBindingHandler"/>
<bindingHandler id="ElementNamespaceContextBindingHandler" bean.class="org.x4o.xml.eld.lang.ElementNamespaceContextBindingHandler"/>
<bindingHandler id="ElementNamespaceBindingHandler" bean.class="org.x4o.xml.eld.lang.ElementNamespaceBindingHandler"/>
<bindingHandler id="StringSplitConverterBindingHandler" bean.class="org.x4o.xml.eld.lang.StringSplitConverterBindingHandler"/>
<bindingHandler id="StringSplitConverterStepBindingHandler" bean.class="org.x4o.xml.eld.lang.StringSplitConverterStepBindingHandler"/>
@ -77,7 +77,7 @@
<description>Some basic language definitions and some helper tags.</description>
<!-- First copy some core elements over from parent config -->
<element id="namespace" objectClass="${parentLanguage.languageConfiguration.defaultElementNamespaceContext}">
<element id="namespace" objectClass="${parentLanguage.languageConfiguration.defaultElementNamespace}">
<description>Defines an namespace for the language.</description>
<attribute id="id" required="true">
<description>The namespace id.</description>

View file

@ -70,7 +70,7 @@ public class EmptyXmlTest extends TestCase {
try {
reader.readResource("tests/empty-xml/empty-test.xml");
} catch (SAXException e) {
assertEquals("No ElementNamespaceContext found for empty namespace.", e.getMessage());
assertEquals("No ElementNamespace found for empty namespace.", e.getMessage());
return;
}
assertEquals(true,false);

View file

@ -76,7 +76,7 @@ public class EldParserTest extends TestCase {
try {
//X4OLanguageModule module = reader.readResource("META-INF/eld/eld-lang.eld");
//List<String> resultTags = new ArrayList<String>(50);
//for (ElementNamespaceContext ns:module.getElementNamespaceContexts()) {
//for (ElementNamespace ns:module.getElementNamespaces()) {
//
//}
/*

View file

@ -32,7 +32,7 @@
<!--
<languageResourcePathPrefix>META-INF</languageResourcePathPrefix>
<languageResourceModulesFileName>-modules.xml</languageResourceModulesFileName>
<defaultElementNamespaceContext>org.x4o.xml.element.DefaultElementNamespaceContext</defaultElementNamespaceContext>
<defaultElementNamespace>org.x4o.xml.element.DefaultElementNamespace</defaultElementNamespace>
<defaultElementInterface>org.x4o.xml.element.DefaultElementInterface</defaultElementInterface>
<defaultElement>org.x4o.xml.element.DefaultElement</defaultElement>
<defaultElementClass>org.x4o.xml.element.DefaultElementClass</defaultElementClass>

View file

@ -43,7 +43,7 @@ import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementConfiguratorGlobal;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementException;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.lang.X4OLanguageModule;
import org.x4o.xml.lang.X4OLanguageContext;
import org.xml.sax.SAXException;
@ -121,7 +121,7 @@ public class EldDocWriter {
doc.addTreeNodePageModeClass(X4OLanguageContext.class);
doc.addTreeNodePageModeClass(X4OLanguageModule.class);
doc.addTreeNodePageModeClass(ElementInterface.class);
doc.addTreeNodePageModeClass(ElementNamespaceContext.class);
doc.addTreeNodePageModeClass(ElementNamespace.class);
doc.addAnnotatedClasses(EldDocWriterLanguage.class);
doc.addAnnotatedClasses(EldDocWriterLanguageModule.class);
@ -132,7 +132,7 @@ public class EldDocWriter {
ApiDocConcept adcRoot = doc.addConcept(new ApiDocConcept(null,C_CONTEXT,X4OLanguageContext.class));
ApiDocConcept adcMod = doc.addConcept(new ApiDocConcept(adcRoot,C_MODULE,X4OLanguageModule.class));
ApiDocConcept adcIface = doc.addConcept(new ApiDocConcept(adcMod,C_INTERFACE,ElementInterface.class));
ApiDocConcept adcNs = doc.addConcept(new ApiDocConcept(adcMod,C_NAMESPACE,ElementNamespaceContext.class));
ApiDocConcept adcNs = doc.addConcept(new ApiDocConcept(adcMod,C_NAMESPACE,ElementNamespace.class));
ApiDocConcept adcEc = doc.addConcept(new ApiDocConcept(adcNs,C_ELEMENT,ElementClass.class));
// mm maybe redo something here
@ -158,7 +158,7 @@ public class EldDocWriter {
for (ElementInterface iface:mod.getElementInterfaces()) { ApiDocNode ifaceNode = modNode.addNode(createNodeElementInterface(iface));
for (ElementClassAttribute eca:iface.getElementClassAttributes()) { ifaceNode.addNode(createNodeElementClassAttribute(eca)); }
for (ElementConfigurator conf:iface.getElementConfigurators()) { ifaceNode.addNode(createNodeElementConfigurator(conf)); } }
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) { ApiDocNode nsNode = modNode.addNode(createNodeElementNamespaceContext(ns));
for (ElementNamespace ns:mod.getElementNamespaces()) { ApiDocNode nsNode = modNode.addNode(createNodeElementNamespace(ns));
for (ElementClass ec:ns.getElementClasses()) { ApiDocNode ecNode = nsNode.addNode(createNodeElementClass(ec));
for (ElementClassAttribute eca:ec.getElementClassAttributes()) { ecNode.addNode(createNodeElementClassAttribute(eca)); }
for (ElementConfigurator conf:ec.getElementConfigurators()) { ecNode.addNode(createNodeElementConfigurator(conf)); } } }
@ -184,7 +184,7 @@ public class EldDocWriter {
private ApiDocNode createNodeElementInterface(ElementInterface iface) {
return new ApiDocNode(iface,iface.getId(),iface.getId(),iface.getDescription());
}
private ApiDocNode createNodeElementNamespaceContext(ElementNamespaceContext ns) {
private ApiDocNode createNodeElementNamespace(ElementNamespace ns) {
return new ApiDocNode(ns,ns.getId(),ns.getUri(),ns.getDescription());
}
private ApiDocNode createNodeElementClass(ElementClass ec) {

View file

@ -37,7 +37,7 @@ import org.x4o.xml.eld.doc.api.dom.ApiDocWriteEvent;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.io.sax.ext.ContentWriterHtml.Tag;
import org.x4o.xml.lang.X4OLanguageContext;
import org.x4o.xml.lang.X4OLanguageModule;
@ -111,7 +111,7 @@ public class EldDocWriterElementClass extends AbstractApiDocWriter {
public void writeElementRelationLinks(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
ApiDocContentWriter writer = event.getWriter();
ElementClass ec = (ElementClass)event.getEventObject().getUserData();
ElementNamespaceContext ns = (ElementNamespaceContext)event.getEventObject().getParent().getUserData();
ElementNamespace ns = (ElementNamespace)event.getEventObject().getParent().getUserData();
X4OLanguageModule mod = (X4OLanguageModule)event.getEventObject().getParent().getParent().getUserData();
X4OLanguageContext context = (X4OLanguageContext)event.getEventObject().getParent().getParent().getParent().getUserData();
@ -163,7 +163,7 @@ public class EldDocWriterElementClass extends AbstractApiDocWriter {
writer.printTagEnd(Tag.dl);
}
private String toElementUri(String pathPrefix,X4OLanguageModule mod,ElementNamespaceContext namespace,ElementClass ec) {
private String toElementUri(String pathPrefix,X4OLanguageModule mod,ElementNamespace namespace,ElementClass ec) {
StringBuffer buf = new StringBuffer(100);
if (pathPrefix!=null) {
buf.append(pathPrefix);

View file

@ -31,7 +31,7 @@ import org.x4o.xml.eld.doc.api.dom.ApiDocNodeBody;
import org.x4o.xml.eld.doc.api.dom.ApiDocNodeData;
import org.x4o.xml.eld.doc.api.dom.ApiDocWriteEvent;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.xml.sax.SAXException;
/**
@ -42,22 +42,22 @@ import org.xml.sax.SAXException;
*/
public class EldDocWriterElementNamespace extends AbstractApiDocWriter {
@ApiDocNodeDataConfiguratorMethod(targetClasses={ElementNamespaceContext.class})
@ApiDocNodeDataConfiguratorMethod(targetClasses={ElementNamespace.class})
public void configNavBar(ApiDoc doc,ApiDocNode node,ApiDocNodeData data) {
clearHrefContentGroup(doc,node,"summary","element",ElementClass.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTableBean(event,"Namespace","description","elementClasses","elementNamespaceInstanceProvider","prefixMapping");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary")
public void writeElementNamespaceElements(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Summary",ElementClass.class);
}
//@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={2})
//@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementNamespace.class},nodeBodyOrders={2})
//public void writeElementNamespaceAttributes(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
// printApiTable(event,"Element Summary",ElementClass.class);
//}

View file

@ -32,7 +32,7 @@ import org.x4o.xml.eld.doc.api.dom.ApiDocWriteEvent;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.lang.X4OLanguageContext;
import org.x4o.xml.lang.X4OLanguageModule;
import org.xml.sax.SAXException;
@ -80,7 +80,7 @@ public class EldDocWriterLanguage extends AbstractApiDocWriter {
bindHandlers += mod.getElementBindingHandlers().size();
interFaces += mod.getElementInterfaces().size();
eleConfigs += mod.getElementConfiguratorGlobals().size();
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
namespaces++;
elements += ns.getElementClasses().size();
}
@ -112,7 +112,7 @@ public class EldDocWriterLanguage extends AbstractApiDocWriter {
writer.docTableStart("Namespace Summary", "All Language Namespaces Overview",ApiDocContentCss.overviewSummary);
writer.docTableHeader("ID", "URI");
for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
writer.docTableRowLink("language/"+ApiDocContentWriter.toSafeUri(mod.getId())+"/"+ApiDocContentWriter.toSafeUri(ns.getId())+"/index.html",ns.getId(),ns.getUri());
}
}

View file

@ -34,7 +34,7 @@ import org.x4o.xml.element.ElementAttributeHandler;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.lang.X4OLanguageModule;
import org.xml.sax.SAXException;
@ -52,7 +52,7 @@ public class EldDocWriterLanguageModule extends AbstractApiDocWriter {
clearHrefContentGroup(doc,node,"summary","binding",ElementBindingHandler.class);
clearHrefContentGroup(doc,node,"summary","attribute",ElementAttributeHandler.class);
clearHrefContentGroup(doc,node,"summary","configurator",ElementConfigurator.class);
clearHrefContentGroup(doc,node,"summary","namespace",ElementNamespaceContext.class);
clearHrefContentGroup(doc,node,"summary","namespace",ElementNamespace.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
@ -77,6 +77,6 @@ public class EldDocWriterLanguageModule extends AbstractApiDocWriter {
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={5},contentGroup="namespace",contentGroupType="summary")
public void writeNamespaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Namespace Summary",ElementNamespaceContext.class);
printApiTable(event,"Namespace Summary",ElementNamespace.class);
}
}

View file

@ -37,7 +37,7 @@ import org.x4o.xml.eld.doc.api.dom.ApiDocWriteEvent;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementInterface;
import org.x4o.xml.element.ElementNamespaceContext;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.io.sax.ext.ContentWriterHtml.Tag;
import org.x4o.xml.lang.X4OLanguageContext;
import org.x4o.xml.lang.X4OLanguageModule;
@ -88,7 +88,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
// temp print old way
List<TreeNode> rootNodes = new ArrayList<TreeNode>(3);
for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
if (ns.getLanguageRoot()!=null && ns.getLanguageRoot()) {
// found language root elements.
for (ElementClass ec:ns.getElementClasses()) {
@ -107,7 +107,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
walkTree(rootNode,e.getWriter(),pathPrefix);
}
}
private String toElementUri(String pathPrefix,X4OLanguageModule mod,ElementNamespaceContext namespace,ElementClass ec) {
private String toElementUri(String pathPrefix,X4OLanguageModule mod,ElementNamespace namespace,ElementClass ec) {
StringBuffer buf = new StringBuffer(100);
if (pathPrefix!=null) {
buf.append(pathPrefix);
@ -142,7 +142,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
List<TreeNode> rootNodes = new ArrayList<TreeNode>(3);
for (X4OLanguageModule mod:context.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
if (ns.getLanguageRoot()!=null && ns.getLanguageRoot()) {
// found language root elements.
for (ElementClass ec:ns.getElementClasses()) {
@ -177,7 +177,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
class TreeNode {
X4OLanguageContext context;
X4OLanguageModule module;
ElementNamespaceContext namespace;
ElementNamespace namespace;
ElementClass elementClass;
TreeNode parent;
int indent = 0;
@ -190,7 +190,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
return result; // hard fail limit
}
for (X4OLanguageModule mod:node.context.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
for (ElementClass ec:ns.getElementClasses()) {
TreeNode n=null;
List<String> tags = ec.getElementParents(node.namespace.getUri());
@ -262,7 +262,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
List<TreeNode> result = new ArrayList<TreeNode>(10);
TreeNode n=null;
for (X4OLanguageModule mod:node.context.getLanguage().getLanguageModules()) {
for (ElementNamespaceContext ns:mod.getElementNamespaceContexts()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
List<String> tags = node.elementClass.getElementParents(ns.getUri());
if (tags!=null) {