X4O: Formated x4o-driver module java classes

This commit is contained in:
Willem Cazander 2025-11-07 22:13:34 +01:00
parent ed096a1427
commit 0b75d4e283
108 changed files with 2420 additions and 2248 deletions

View file

@ -63,8 +63,6 @@ public abstract class X4ODriver<T> {
*/ */
abstract public String[] getLanguageVersions(); abstract public String[] getLanguageVersions();
// =============== build methods to override // =============== build methods to override
protected X4OLanguage buildLanguage(String version) { protected X4OLanguage buildLanguage(String version) {
@ -79,8 +77,6 @@ public abstract class X4ODriver<T> {
return X4ODriverManager.getDefaultBuildLanguageConfiguration(); return X4ODriverManager.getDefaultBuildLanguageConfiguration();
} }
// =============== Reader // =============== Reader
public X4OReader<T> createReader() { public X4OReader<T> createReader() {
@ -99,8 +95,6 @@ public abstract class X4ODriver<T> {
return new DefaultX4OReader<T>(createLanguage(version)); return new DefaultX4OReader<T>(createLanguage(version));
} }
// =============== Writer // =============== Writer
public X4OWriter<T> createWriter() { public X4OWriter<T> createWriter() {
@ -119,12 +113,11 @@ public abstract class X4ODriver<T> {
return new DefaultX4OWriter<T>(createLanguage(version)); return new DefaultX4OWriter<T>(createLanguage(version));
} }
// =============== Language // =============== Language
/** /**
* Returns the default language which is the latest version. * Returns the default language which is the latest version.
*
* @return The default language version. * @return The default language version.
*/ */
final public String getLanguageVersionDefault() { final public String getLanguageVersionDefault() {
@ -133,6 +126,7 @@ public abstract class X4ODriver<T> {
/** /**
* Creates the X4OLanguage for the specified version. * Creates the X4OLanguage for the specified version.
*
* @param version The language version to create. * @param version The language version to create.
* @return The created X4OLanguage. * @return The created X4OLanguage.
*/ */
@ -142,14 +136,13 @@ public abstract class X4ODriver<T> {
/** /**
* Creates the X4OLanguage for the default version. * Creates the X4OLanguage for the default version.
*
* @return The created X4OLanguage. * @return The created X4OLanguage.
*/ */
final public X4OLanguage createLanguage() { final public X4OLanguage createLanguage() {
return buildLanguage(getLanguageVersionDefault()); return buildLanguage(getLanguageVersionDefault());
} }
// =============== Language Tasks // =============== Language Tasks
final public X4OLanguageTask getLanguageTask(String taskId) { final public X4OLanguageTask getLanguageTask(String taskId) {

View file

@ -38,7 +38,9 @@ abstract public class AbstractObjectConverter implements ObjectConverter {
protected List<ObjectConverter> converters = new ArrayList<ObjectConverter>(5); protected List<ObjectConverter> converters = new ArrayList<ObjectConverter>(5);
abstract public Object convertAfterTo(Object obj, Locale locale) throws ObjectConverterException; abstract public Object convertAfterTo(Object obj, Locale locale) throws ObjectConverterException;
abstract public Object convertAfterBack(Object obj, Locale locale) throws ObjectConverterException; abstract public Object convertAfterBack(Object obj, Locale locale) throws ObjectConverterException;
abstract public ObjectConverter clone() throws CloneNotSupportedException; abstract public ObjectConverter clone() throws CloneNotSupportedException;
protected List<ObjectConverter> cloneConverters() throws CloneNotSupportedException { protected List<ObjectConverter> cloneConverters() throws CloneNotSupportedException {

View file

@ -53,5 +53,6 @@ abstract public class AbstractStringObjectConverter extends AbstractObjectConver
} }
abstract public Object convertStringTo(String str, Locale locale) throws ObjectConverterException; abstract public Object convertStringTo(String str, Locale locale) throws ObjectConverterException;
abstract public String convertStringBack(Object obj, Locale locale) throws ObjectConverterException; abstract public String convertStringBack(Object obj, Locale locale) throws ObjectConverterException;
} }

View file

@ -55,6 +55,7 @@ public class DefaultObjectConverterProvider implements ObjectConverterProvider {
/** /**
* Create new DefaultObjectConverterProvider. * Create new DefaultObjectConverterProvider.
*
* @param addDefaults When true do the addDefaults(). * @param addDefaults When true do the addDefaults().
*/ */
public DefaultObjectConverterProvider(boolean addDefaults) { public DefaultObjectConverterProvider(boolean addDefaults) {

View file

@ -46,6 +46,7 @@ public interface ObjectConverter extends Cloneable,Serializable {
/** /**
* Convert to the object. * Convert to the object.
*
* @param obj The object to convert. * @param obj The object to convert.
* @param locale The Object convert locale if needed. * @param locale The Object convert locale if needed.
* @return Returns the converted object. * @return Returns the converted object.
@ -55,6 +56,7 @@ public interface ObjectConverter extends Cloneable,Serializable {
/** /**
* Convert the object back. * Convert the object back.
*
* @param obj The object to convert. * @param obj The object to convert.
* @param locale The Object convert locale if needed. * @param locale The Object convert locale if needed.
* @return Returns the converted object. * @return Returns the converted object.

View file

@ -35,6 +35,7 @@ public class ObjectConverterException extends Exception {
/** /**
* Creates an ObjectConverterException. * Creates an ObjectConverterException.
*
* @param converter The converter which has the exception. * @param converter The converter which has the exception.
* @param message The exception message. * @param message The exception message.
*/ */
@ -45,6 +46,7 @@ public class ObjectConverterException extends Exception {
/** /**
* Creates an ObjectConverterException. * Creates an ObjectConverterException.
*
* @param converter The converter which has the exception. * @param converter The converter which has the exception.
* @param message The exception message. * @param message The exception message.
* @param exception The parent exception. * @param exception The parent exception.

View file

@ -32,6 +32,7 @@ public interface ObjectConverterProvider {
/** /**
* Provides an ObjectConvert based on the converted class result. * Provides an ObjectConvert based on the converted class result.
*
* @param clazz The result class we want. * @param clazz The result class we want.
* @return The ObjectConverter which can convert for us. * @return The ObjectConverter which can convert for us.
*/ */

View file

@ -40,14 +40,13 @@ public class EnumConverter extends AbstractStringObjectConverter {
private static final long serialVersionUID = 8860785472427794548L; private static final long serialVersionUID = 8860785472427794548L;
private String enumClass = null; private String enumClass = null;
private Class enumObjectClass = null; private Class enumObjectClass = null;
/** /**
* Returns the convert to class. * Returns the convert to class.
*
* @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo() * @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo()
* @return The class to convert to. * @return The class to convert to.
*/ */
@ -105,7 +104,6 @@ public class EnumConverter extends AbstractStringObjectConverter {
return enumClass; return enumClass;
} }
/** /**
* @param enumClass the enumClass to set * @param enumClass the enumClass to set
*/ */
@ -115,6 +113,7 @@ public class EnumConverter extends AbstractStringObjectConverter {
/** /**
* Clone this ObjectConverter. * Clone this ObjectConverter.
*
* @see org.x4o.xml.conv.AbstractObjectConverter#clone() * @see org.x4o.xml.conv.AbstractObjectConverter#clone()
* @return The cloned ObjectConverter. * @return The cloned ObjectConverter.
* @throws CloneNotSupportedException When cloning fails. * @throws CloneNotSupportedException When cloning fails.

View file

@ -40,6 +40,7 @@ public class FloatConverter extends AbstractStringObjectConverter {
/** /**
* Returns the convert to class. * Returns the convert to class.
*
* @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo() * @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo()
* @return The class to convert to. * @return The class to convert to.
*/ */
@ -75,6 +76,7 @@ public class FloatConverter extends AbstractStringObjectConverter {
/** /**
* Clone this ObjectConverter. * Clone this ObjectConverter.
*
* @see org.x4o.xml.conv.AbstractObjectConverter#clone() * @see org.x4o.xml.conv.AbstractObjectConverter#clone()
* @return The cloned ObjectConverter. * @return The cloned ObjectConverter.
* @throws CloneNotSupportedException When cloning fails. * @throws CloneNotSupportedException When cloning fails.

View file

@ -40,6 +40,7 @@ public class IntegerConverter extends AbstractStringObjectConverter {
/** /**
* Returns the convert to class. * Returns the convert to class.
*
* @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo() * @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo()
* @return The class to convert to. * @return The class to convert to.
*/ */
@ -75,6 +76,7 @@ public class IntegerConverter extends AbstractStringObjectConverter {
/** /**
* Clone this ObjectConverter. * Clone this ObjectConverter.
*
* @see org.x4o.xml.conv.AbstractObjectConverter#clone() * @see org.x4o.xml.conv.AbstractObjectConverter#clone()
* @return The cloned ObjectConverter. * @return The cloned ObjectConverter.
* @throws CloneNotSupportedException When cloning fails. * @throws CloneNotSupportedException When cloning fails.

View file

@ -40,6 +40,7 @@ public class LongConverter extends AbstractStringObjectConverter {
/** /**
* Returns the convert to class. * Returns the convert to class.
*
* @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo() * @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo()
* @return The class to convert to. * @return The class to convert to.
*/ */
@ -75,6 +76,7 @@ public class LongConverter extends AbstractStringObjectConverter {
/** /**
* Clone this ObjectConverter. * Clone this ObjectConverter.
*
* @see org.x4o.xml.conv.AbstractObjectConverter#clone() * @see org.x4o.xml.conv.AbstractObjectConverter#clone()
* @return The cloned ObjectConverter. * @return The cloned ObjectConverter.
* @throws CloneNotSupportedException When cloning fails. * @throws CloneNotSupportedException When cloning fails.

View file

@ -56,6 +56,7 @@ public class StringSplitConverter extends AbstractStringObjectConverter {
/** /**
* Returns the convert to class. * Returns the convert to class.
*
* @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo() * @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo()
* @return The class to convert to. * @return The class to convert to.
*/ */
@ -162,6 +163,7 @@ public class StringSplitConverter extends AbstractStringObjectConverter {
/** /**
* Clone this ObjectConverter. * Clone this ObjectConverter.
*
* @see org.x4o.xml.conv.AbstractObjectConverter#clone() * @see org.x4o.xml.conv.AbstractObjectConverter#clone()
* @return The cloned ObjectConverter. * @return The cloned ObjectConverter.
* @throws CloneNotSupportedException When cloning fails. * @throws CloneNotSupportedException When cloning fails.
@ -182,7 +184,11 @@ public class StringSplitConverter extends AbstractStringObjectConverter {
public class StringSplitConverterStepComparator implements Comparator<StringSplitConverterStep> { public class StringSplitConverterStepComparator implements Comparator<StringSplitConverterStep> {
boolean isTo = true; boolean isTo = true;
public StringSplitConverterStepComparator(boolean isTo) { this.isTo=isTo; }
public StringSplitConverterStepComparator(boolean isTo) {
this.isTo = isTo;
}
public int compare(StringSplitConverterStep e1, StringSplitConverterStep e2) { public int compare(StringSplitConverterStep e1, StringSplitConverterStep e2) {
if (isTo) { if (isTo) {
return e1.getToOrder().compareTo(e2.getToOrder()); return e1.getToOrder().compareTo(e2.getToOrder());
@ -287,9 +293,11 @@ public class StringSplitConverter extends AbstractStringObjectConverter {
public void addStringSplitConverterStep(StringSplitConverterStep stringSplitConverterStep) { public void addStringSplitConverterStep(StringSplitConverterStep stringSplitConverterStep) {
stringSplitConverterSteps.add(stringSplitConverterStep); stringSplitConverterSteps.add(stringSplitConverterStep);
} }
public void removeStringSplitConverterStep(StringSplitConverterStep stringSplitConverterStep) { public void removeStringSplitConverterStep(StringSplitConverterStep stringSplitConverterStep) {
stringSplitConverterSteps.remove(stringSplitConverterStep); stringSplitConverterSteps.remove(stringSplitConverterStep);
} }
public List<StringSplitConverterStep> getStringSplitConverterSteps() { public List<StringSplitConverterStep> getStringSplitConverterSteps() {
return stringSplitConverterSteps; return stringSplitConverterSteps;
} }

View file

@ -42,6 +42,7 @@ public class URLConverter extends AbstractStringObjectConverter {
/** /**
* Returns the convert to class. * Returns the convert to class.
*
* @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo() * @see org.x4o.xml.conv.ObjectConverter#getObjectClassTo()
* @return The class to convert to. * @return The class to convert to.
*/ */
@ -81,6 +82,7 @@ public class URLConverter extends AbstractStringObjectConverter {
/** /**
* Clone this ObjectConverter. * Clone this ObjectConverter.
*
* @see org.x4o.xml.conv.AbstractObjectConverter#clone() * @see org.x4o.xml.conv.AbstractObjectConverter#clone()
* @return The cloned ObjectConverter. * @return The cloned ObjectConverter.
* @throws CloneNotSupportedException When cloning fails. * @throws CloneNotSupportedException When cloning fails.

View file

@ -65,6 +65,7 @@ public class X4OELContext extends ELContext {
/** /**
* Returns the ELResolver. * Returns the ELResolver.
*
* @return The ELResolver. * @return The ELResolver.
* @see javax.el.ELContext#getELResolver() * @see javax.el.ELContext#getELResolver()
*/ */
@ -75,6 +76,7 @@ public class X4OELContext extends ELContext {
/** /**
* Returns the FunctionMapper. * Returns the FunctionMapper.
*
* @return The FunctionMapper. * @return The FunctionMapper.
* @see javax.el.ELContext#getFunctionMapper() * @see javax.el.ELContext#getFunctionMapper()
*/ */
@ -85,6 +87,7 @@ public class X4OELContext extends ELContext {
/** /**
* Returns the VariableMapper. * Returns the VariableMapper.
*
* @return The VariableMapper. * @return The VariableMapper.
* @see javax.el.ELContext#getVariableMapper() * @see javax.el.ELContext#getVariableMapper()
*/ */

View file

@ -51,6 +51,7 @@ public class X4OELFunctionMapper extends FunctionMapper {
/** /**
* Resolves method el functions. * Resolves method el functions.
*
* @param prefix The function prefix. * @param prefix The function prefix.
* @param localName The local name of function. * @param localName The local name of function.
* @return The resolved function or null is not found. * @return The resolved function or null is not found.
@ -63,6 +64,7 @@ public class X4OELFunctionMapper extends FunctionMapper {
/** /**
* Add an static method to the function mapper. * Add an static method to the function mapper.
*
* @param prefix The function prefix. * @param prefix The function prefix.
* @param localName The local name of function. * @param localName The local name of function.
* @param method The method to execute on. * @param method The method to execute on.

View file

@ -29,7 +29,6 @@ import javax.el.ELContext;
import javax.el.ELResolver; import javax.el.ELResolver;
import javax.el.MapELResolver; import javax.el.MapELResolver;
/** /**
* X4OELResolver simple EL resolver. * X4OELResolver simple EL resolver.
* *
@ -43,6 +42,7 @@ public class X4OELResolver extends ELResolver {
/** /**
* Creates X4OELResolver which is backed by the objectStore. * Creates X4OELResolver which is backed by the objectStore.
*
* @param objectStore The objectStore. * @param objectStore The objectStore.
*/ */
public X4OELResolver(Map<Object, Object> objectStore) { public X4OELResolver(Map<Object, Object> objectStore) {
@ -52,6 +52,7 @@ public class X4OELResolver extends ELResolver {
/** /**
* Checks if base object is null and else return objectStore. * Checks if base object is null and else return objectStore.
*
* @param base The base object to check. * @param base The base object to check.
* @return Returns the base object or objectStore. * @return Returns the base object or objectStore.
*/ */

View file

@ -48,7 +48,8 @@ public class X4OExpressionFactory {
Class<?> expressionFactoryClass = X4OLanguageClassLoader.loadClass(EL_FACTORY_IMPL_ODYSSEUS); Class<?> expressionFactoryClass = X4OLanguageClassLoader.loadClass(EL_FACTORY_IMPL_ODYSSEUS);
result = X4OLanguageClassLoader.newInstance(ExpressionFactory.class, expressionFactoryClass); result = X4OLanguageClassLoader.newInstance(ExpressionFactory.class, expressionFactoryClass);
} catch (ClassNotFoundException ee) { } catch (ClassNotFoundException ee) {
throw new RuntimeException("Could not load ExpressionFactory tried: "+EL_FACTORY_IMPL_APACHE+" and "+EL_FACTORY_IMPL_ODYSSEUS+" but could not load one of them."); throw new RuntimeException("Could not load ExpressionFactory tried: " + EL_FACTORY_IMPL_APACHE + " and " + EL_FACTORY_IMPL_ODYSSEUS
+ " but could not load one of them.");
} }
} }
return result; return result;

View file

@ -26,8 +26,7 @@ import org.x4o.xml.X4ODriver;
import org.x4o.xml.lang.X4OLanguageModule; import org.x4o.xml.lang.X4OLanguageModule;
/** /**
* An Element Language Definition X4O parser. * An Element Language Definition X4O parser. This eld parser config parent x4o parser with the eld x4o parser.
* This eld parser config parent x4o parser with the eld x4o parser.
* *
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Aug 20, 2005 * @version 1.0 Aug 20, 2005

View file

@ -61,6 +61,7 @@ public class EldModuleLoader implements X4OLanguageModuleLoader {
/** /**
* Creates an ELD/CEL module loader. * Creates an ELD/CEL module loader.
*
* @param eldResource The resource to load. * @param eldResource The resource to load.
* @param isEldCore If true then load CEL else load ELD. * @param isEldCore If true then load CEL else load ELD.
*/ */
@ -75,13 +76,15 @@ public class EldModuleLoader implements X4OLanguageModuleLoader {
/** /**
* Loads the ELD language into the module. * Loads the ELD language into the module.
*
* @param session The session we run in. * @param session The session we run in.
* @param language The local Language to load for. * @param language The local Language to load for.
* @param module The language module to load it into. * @param module The language module to load it into.
* @throws X4OLanguageModuleLoaderException When eld language could not be loaded. * @throws X4OLanguageModuleLoaderException When eld language could not be loaded.
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageModuleLocal) * @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageModuleLocal)
*/ */
public void loadLanguageModule(X4OLanguageSession session, X4OLanguageLocal language, X4OLanguageModuleLocal module) throws X4OLanguageModuleLoaderException { public void loadLanguageModule(X4OLanguageSession session, X4OLanguageLocal language, X4OLanguageModuleLocal module)
throws X4OLanguageModuleLoaderException {
logger.fine("Loading name eld file from resource: " + eldResource); logger.fine("Loading name eld file from resource: " + eldResource);
try { try {
X4ODriver<?> driver = null; X4ODriver<?> driver = null;
@ -107,12 +110,14 @@ public class EldModuleLoader implements X4OLanguageModuleLoader {
} }
public static X4OLanguage getLanguage(X4OLanguageSession context) { public static X4OLanguage getLanguage(X4OLanguageSession context) {
ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),"${"+EL_PARENT_LANGUAGE+"}", X4OLanguage.class); ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),
"${" + EL_PARENT_LANGUAGE + "}", X4OLanguage.class);
return (X4OLanguage) ee.getValue(context.getExpressionLanguageContext()); return (X4OLanguage) ee.getValue(context.getExpressionLanguageContext());
} }
public static X4OLanguageModule getLanguageModule(X4OLanguageSession context) { public static X4OLanguageModule getLanguageModule(X4OLanguageSession context) {
ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),"${"+EL_PARENT_LANGUAGE_MODULE+"}", X4OLanguageModule.class); ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),
"${" + EL_PARENT_LANGUAGE_MODULE + "}", X4OLanguageModule.class);
return (X4OLanguageModule) ee.getValue(context.getExpressionLanguageContext()); return (X4OLanguageModule) ee.getValue(context.getExpressionLanguageContext());
} }
} }

View file

@ -51,8 +51,7 @@ import org.x4o.xml.lang.X4OLanguageModuleLocal;
import org.x4o.xml.lang.X4OLanguageSession; import org.x4o.xml.lang.X4OLanguageSession;
/** /**
* EldModuleLoaderCore provides a few basic elements for the core eld x4o * EldModuleLoaderCore provides a few basic elements for the core eld x4o language.
* language.
* *
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Jan 11, 2009 * @version 1.0 Jan 11, 2009
@ -89,11 +88,11 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
* @param session The session to run in. * @param session The session to run in.
* @param language The langauge to load for. * @param language The langauge to load for.
* @param languageModule The module to load it in. * @param languageModule The module to load it in.
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, * @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageModuleLocald)
* org.x4o.xml.lang.X4OLanguageModuleLocald)
*/ */
@Override @Override
public void loadLanguageModule(X4OLanguageSession session, X4OLanguageLocal language, X4OLanguageModuleLocal languageModule) throws X4OLanguageModuleLoaderException { public void loadLanguageModule(X4OLanguageSession session, X4OLanguageLocal language, X4OLanguageModuleLocal languageModule)
throws X4OLanguageModuleLoaderException {
// Config module meta data // Config module meta data
configLanguageModule(languageModule); configLanguageModule(languageModule);
@ -113,7 +112,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
// Create cel-root namespace in language for schema support // Create cel-root namespace in language for schema support
ElementNamespace 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. 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."); 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)); rootElement.addElementClassAttribute(createElementClassAttribute(language, "id", true, null));
rootElement.addElementClassAttribute(createElementClassAttribute(language, "providerHost", true, null)); rootElement.addElementClassAttribute(createElementClassAttribute(language, "providerHost", true, null));
namespaceRoot.addElementClass(rootElement); namespaceRoot.addElementClass(rootElement);
@ -130,14 +130,16 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
private void configElementClasses(X4OLanguage language, ElementNamespace namespace) throws X4OLanguageModuleLoaderException { private void configElementClasses(X4OLanguage language, ElementNamespace namespace) throws X4OLanguageModuleLoaderException {
ElementClass ec = null; ElementClass ec = null;
namespace.addElementClass(createElementClass(language, "attribute", language.getLanguageConfiguration().getDefaultElementClassAttribute(), null, "Defines xml element attribute.")); namespace.addElementClass(createElementClass(language, "attribute", language.getLanguageConfiguration().getDefaultElementClassAttribute(), null,
"Defines xml element attribute."));
ec = createElementClass(language, "attributeAlias", null, AttributeAliasElement.class, "Adds an attribute alias."); ec = createElementClass(language, "attributeAlias", null, AttributeAliasElement.class, "Adds an attribute alias.");
ec.addElementClassAttribute(createElementClassAttribute(language, "name", true, null)); ec.addElementClassAttribute(createElementClassAttribute(language, "name", true, null));
ec.addElementParent(CEL_CORE_URI, "attribute"); ec.addElementParent(CEL_CORE_URI, "attribute");
namespace.addElementClass(ec); namespace.addElementClass(ec);
namespace.addElementClass(createElementClass(language, "classConverter", ClassConverter.class, null, "Converts string attribute to java class instance.")); namespace.addElementClass(
createElementClass(language, "classConverter", ClassConverter.class, null, "Converts string attribute to java class instance."));
ec = createElementClass(language, "namespace", language.getLanguageConfiguration().getDefaultElementNamespace(), null, "Defines an xml namespace."); ec = createElementClass(language, "namespace", language.getLanguageConfiguration().getDefaultElementNamespace(), null, "Defines an xml namespace.");
ec.addElementClassAttribute(createElementClassAttribute(language, "uri", true, null)); ec.addElementClassAttribute(createElementClassAttribute(language, "uri", true, null));
@ -148,7 +150,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
ec.addElementClassAttribute(createElementClassAttribute(language, "elementClass", false, new ClassConverter())); ec.addElementClassAttribute(createElementClassAttribute(language, "elementClass", false, new ClassConverter()));
namespace.addElementClass(ec); namespace.addElementClass(ec);
ec = createElementClass(language, "elementInterface", language.getLanguageConfiguration().getDefaultElementInterface(), null, "Defines element interface class."); ec = createElementClass(language, "elementInterface", language.getLanguageConfiguration().getDefaultElementInterface(), null,
"Defines element interface class.");
ec.addElementClassAttribute(createElementClassAttribute(language, "interfaceClass", false, new ClassConverter())); ec.addElementClassAttribute(createElementClassAttribute(language, "interfaceClass", false, new ClassConverter()));
namespace.addElementClass(ec); namespace.addElementClass(ec);
@ -204,7 +207,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
languageModule.setDescription("Core Element Language Module Loader"); languageModule.setDescription("Core Element Language Module Loader");
} }
private void startAndAddNamespace(X4OLanguageLocal language, X4OLanguageModuleLocal languageModule, ElementNamespace namespace) throws X4OLanguageModuleLoaderException { private void startAndAddNamespace(X4OLanguageLocal language, X4OLanguageModuleLocal languageModule, ElementNamespace namespace)
throws X4OLanguageModuleLoaderException {
try { try {
namespace.getElementNamespaceInstanceProvider().start(language, namespace); namespace.getElementNamespaceInstanceProvider().start(language, namespace);
} catch (ElementNamespaceInstanceProviderException e) { } catch (ElementNamespaceInstanceProviderException e) {
@ -213,7 +217,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
languageModule.addElementNamespace(namespace); languageModule.addElementNamespace(namespace);
} }
private ElementNamespace 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."); logger.finer("Creating " + language.getLanguageName() + " namespace.");
ElementNamespace namespace; ElementNamespace namespace;
try { try {
@ -222,7 +227,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
throw new X4OLanguageModuleLoaderException(this, e.getMessage(), e); throw new X4OLanguageModuleLoaderException(this, e.getMessage(), e);
} }
try { try {
namespace.setElementNamespaceInstanceProvider(X4OLanguageClassLoader.newInstance(ElementNamespaceInstanceProvider.class, language.getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider())); namespace.setElementNamespaceInstanceProvider(X4OLanguageClassLoader.newInstance(ElementNamespaceInstanceProvider.class,
language.getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider()));
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
throw new X4OLanguageModuleLoaderException(this, e.getMessage(), e); throw new X4OLanguageModuleLoaderException(this, e.getMessage(), e);
} }
@ -234,7 +240,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
return namespace; return namespace;
} }
private ElementClass createElementClass(X4OLanguage language, String tag, Class<?> objectClass, Class<?> elementClass, String description) throws X4OLanguageModuleLoaderException { private ElementClass createElementClass(X4OLanguage language, String tag, Class<?> objectClass, Class<?> elementClass, String description)
throws X4OLanguageModuleLoaderException {
try { try {
ElementClass result = X4OLanguageClassLoader.newInstance(ElementClass.class, language.getLanguageConfiguration().getDefaultElementClass()); ElementClass result = X4OLanguageClassLoader.newInstance(ElementClass.class, language.getLanguageConfiguration().getDefaultElementClass());
result.setId(tag); result.setId(tag);
@ -257,9 +264,11 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
* @return The new ElementClassAttribute instance. * @return The new ElementClassAttribute instance.
* @throws X4OLanguageModuleLoaderException When class could not be created. * @throws X4OLanguageModuleLoaderException When class could not be created.
*/ */
private ElementClassAttribute createElementClassAttribute(X4OLanguage language, String name, boolean required, ObjectConverter converter) throws X4OLanguageModuleLoaderException { private ElementClassAttribute createElementClassAttribute(X4OLanguage language, String name, boolean required, ObjectConverter converter)
throws X4OLanguageModuleLoaderException {
try { try {
ElementClassAttribute result = X4OLanguageClassLoader.newInstance(ElementClassAttribute.class, language.getLanguageConfiguration().getDefaultElementClassAttribute()); ElementClassAttribute result = X4OLanguageClassLoader.newInstance(ElementClassAttribute.class,
language.getLanguageConfiguration().getDefaultElementClassAttribute());
result.setId(name); result.setId(name);
if (required) { if (required) {
result.setRequired(required); result.setRequired(required);

View file

@ -61,6 +61,7 @@ import org.x4o.xml.lang.X4OLanguageSession;
*/ */
public class EldDocWriter { public class EldDocWriter {
//@formatter:off
private final static String DEFAULT_NAME = "X4O ELD DOC"; private final static String DEFAULT_NAME = "X4O ELD DOC";
private final static String DEFAULT_DESCRIPTION = "X4O Meta Language Documentation."; private final static String DEFAULT_DESCRIPTION = "X4O Meta Language Documentation.";
@ -116,6 +117,7 @@ public class EldDocWriter {
new PropertyConfigItem(PAGE_PRINT_HELP,Boolean.class,true) new PropertyConfigItem(PAGE_PRINT_HELP,Boolean.class,true)
); );
} }
//@formatter:on
/** The config of this writer. */ /** The config of this writer. */
private final SAX3PropertyConfig propertyConfig; private final SAX3PropertyConfig propertyConfig;
@ -125,6 +127,7 @@ public class EldDocWriter {
/** /**
* Creates an EldDocGenerator for this langauge context. * Creates an EldDocGenerator for this langauge context.
*
* @param language The language to generate doc for. * @param language The language to generate doc for.
*/ */
public EldDocWriter(X4OLanguage language, SAX3PropertyConfig parentConfig) { public EldDocWriter(X4OLanguage language, SAX3PropertyConfig parentConfig) {
@ -135,6 +138,7 @@ public class EldDocWriter {
/** /**
* Writes the language documentation to the base path. * Writes the language documentation to the base path.
*
* @throws ElementException Is thrown when error is done. * @throws ElementException Is thrown when error is done.
*/ */
public void writeDocumentation() throws ElementException { public void writeDocumentation() throws ElementException {
@ -150,6 +154,7 @@ public class EldDocWriter {
/** /**
* Creates a fully configured ApiDco object. * Creates a fully configured ApiDco object.
*
* @return The ApiDoc configured to write eld documentation. * @return The ApiDoc configured to write eld documentation.
*/ */
private MaisDoc buildLanguageDoc() { private MaisDoc buildLanguageDoc() {
@ -214,25 +219,55 @@ public class EldDocWriter {
adcEc.addChildConcept(new MaisDocConcept(adcEc, CC_ATTRIBUTE, ElementClassAttribute.class)); adcEc.addChildConcept(new MaisDocConcept(adcEc, CC_ATTRIBUTE, ElementClassAttribute.class));
// Non-tree pages config // Non-tree pages config
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_XTREE)) { doc.addDocPage(EldDocXTreePageWriter.createDocPage()); } if (propertyConfig.getPropertyBoolean(PAGE_PRINT_XTREE)) {
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_TREE)) { doc.addDocPage(DefaultPageWriterTree.createDocPage()); } doc.addDocPage(EldDocXTreePageWriter.createDocPage());
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_INDEX_ALL)) { doc.addDocPage(DefaultPageWriterIndexAll.createDocPage()); } }
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_HELP)) { doc.addDocPage(DefaultPageWriterHelp.createDocPage()); } if (propertyConfig.getPropertyBoolean(PAGE_PRINT_TREE)) {
doc.addDocPage(DefaultPageWriterTree.createDocPage());
}
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_INDEX_ALL)) {
doc.addDocPage(DefaultPageWriterIndexAll.createDocPage());
}
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_HELP)) {
doc.addDocPage(DefaultPageWriterHelp.createDocPage());
}
// Doc tree config // Doc tree config
MaisDocNode rootNode = new MaisDocNode(language,"language",getLanguageNameUpperCase()+" Language","The X4O "+getLanguageNameUpperCase()+" Language"); MaisDocNode rootNode = new MaisDocNode(language, "language", getLanguageNameUpperCase() + " Language",
"The X4O " + getLanguageNameUpperCase() + " Language");
doc.setRootNode(rootNode); doc.setRootNode(rootNode);
for (X4OLanguageModule mod:language.getLanguageModules()) { MaisDocNode modNode = rootNode.addNode(createNodeLanguageModule(mod)); for (X4OLanguageModule mod : language.getLanguageModules()) {
for (ElementBindingHandler bind:mod.getElementBindingHandlers()) { modNode.addNode(createNodeElementBindingHandler(bind)); } MaisDocNode modNode = rootNode.addNode(createNodeLanguageModule(mod));
for (ElementConfiguratorGlobal conf:mod.getElementConfiguratorGlobals()) { modNode.addNode(createNodeElementConfiguratorGlobal(conf)); } for (ElementBindingHandler bind : mod.getElementBindingHandlers()) {
for (ElementInterface iface:mod.getElementInterfaces()) { MaisDocNode ifaceNode = modNode.addNode(createNodeElementInterface(iface)); modNode.addNode(createNodeElementBindingHandler(bind));
for (ElementClassAttribute eca:iface.getElementClassAttributes()) { ifaceNode.addNode(createNodeElementClassAttribute(eca)); } }
for (ElementConfigurator conf:iface.getElementConfigurators()) { ifaceNode.addNode(createNodeElementConfigurator(conf)); } } for (ElementConfiguratorGlobal conf : mod.getElementConfiguratorGlobals()) {
for (ElementNamespace ns:mod.getElementNamespaces()) { MaisDocNode nsNode = modNode.addNode(createNodeElementNamespace(ns)); modNode.addNode(createNodeElementConfiguratorGlobal(conf));
for (ElementNamespaceAttribute attr:ns.getElementNamespaceAttributes()) { nsNode.addNode(createNodeElementNamespaceAttribute(attr)); } }
for (ElementClass ec:ns.getElementClasses()) { MaisDocNode ecNode = nsNode.addNode(createNodeElementClass(ec)); for (ElementInterface iface : mod.getElementInterfaces()) {
for (ElementClassAttribute eca:ec.getElementClassAttributes()) { ecNode.addNode(createNodeElementClassAttribute(eca)); } MaisDocNode ifaceNode = modNode.addNode(createNodeElementInterface(iface));
for (ElementConfigurator conf:ec.getElementConfigurators()) { ecNode.addNode(createNodeElementConfigurator(conf)); } } } for (ElementClassAttribute eca : iface.getElementClassAttributes()) {
ifaceNode.addNode(createNodeElementClassAttribute(eca));
}
for (ElementConfigurator conf : iface.getElementConfigurators()) {
ifaceNode.addNode(createNodeElementConfigurator(conf));
}
}
for (ElementNamespace ns : mod.getElementNamespaces()) {
MaisDocNode nsNode = modNode.addNode(createNodeElementNamespace(ns));
for (ElementNamespaceAttribute attr : ns.getElementNamespaceAttributes()) {
nsNode.addNode(createNodeElementNamespaceAttribute(attr));
}
for (ElementClass ec : ns.getElementClasses()) {
MaisDocNode ecNode = nsNode.addNode(createNodeElementClass(ec));
for (ElementClassAttribute eca : ec.getElementClassAttributes()) {
ecNode.addNode(createNodeElementClassAttribute(eca));
}
for (ElementConfigurator conf : ec.getElementConfigurators()) {
ecNode.addNode(createNodeElementConfigurator(conf));
}
}
}
} }
return doc; return doc;
} }
@ -240,27 +275,35 @@ public class EldDocWriter {
private MaisDocNode createNodeElementBindingHandler(ElementBindingHandler bind) { private MaisDocNode createNodeElementBindingHandler(ElementBindingHandler bind) {
return new MaisDocNode(bind, bind.getId(), bind.getId(), bind.getDescription()); return new MaisDocNode(bind, bind.getId(), bind.getId(), bind.getDescription());
} }
private MaisDocNode createNodeElementNamespaceAttribute(ElementNamespaceAttribute attr) { private MaisDocNode createNodeElementNamespaceAttribute(ElementNamespaceAttribute attr) {
return new MaisDocNode(attr, attr.getId(), attr.getId(), attr.getDescription()); return new MaisDocNode(attr, attr.getId(), attr.getId(), attr.getDescription());
} }
private MaisDocNode createNodeElementConfiguratorGlobal(ElementConfiguratorGlobal conf) { private MaisDocNode createNodeElementConfiguratorGlobal(ElementConfiguratorGlobal conf) {
return new MaisDocNode(conf, conf.getId(), conf.getId(), conf.getDescription()); return new MaisDocNode(conf, conf.getId(), conf.getId(), conf.getDescription());
} }
private MaisDocNode createNodeElementConfigurator(ElementConfigurator conf) { private MaisDocNode createNodeElementConfigurator(ElementConfigurator conf) {
return new MaisDocNode(conf, conf.getId(), conf.getId(), conf.getDescription()); return new MaisDocNode(conf, conf.getId(), conf.getId(), conf.getDescription());
} }
private MaisDocNode createNodeLanguageModule(X4OLanguageModule mod) { private MaisDocNode createNodeLanguageModule(X4OLanguageModule mod) {
return new MaisDocNode(mod, mod.getId(), mod.getId(), mod.getDescription()); return new MaisDocNode(mod, mod.getId(), mod.getId(), mod.getDescription());
} }
private MaisDocNode createNodeElementInterface(ElementInterface iface) { private MaisDocNode createNodeElementInterface(ElementInterface iface) {
return new MaisDocNode(iface, iface.getId(), iface.getId(), iface.getDescription()); return new MaisDocNode(iface, iface.getId(), iface.getId(), iface.getDescription());
} }
private MaisDocNode createNodeElementNamespace(ElementNamespace ns) { private MaisDocNode createNodeElementNamespace(ElementNamespace ns) {
return new MaisDocNode(ns, ns.getId(), ns.getUri(), ns.getDescription()); return new MaisDocNode(ns, ns.getId(), ns.getUri(), ns.getDescription());
} }
private MaisDocNode createNodeElementClass(ElementClass ec) { private MaisDocNode createNodeElementClass(ElementClass ec) {
return new MaisDocNode(ec, ec.getId(), ec.getId(), ec.getDescription()); return new MaisDocNode(ec, ec.getId(), ec.getId(), ec.getDescription());
} }
private MaisDocNode createNodeElementClassAttribute(ElementClassAttribute eca) { private MaisDocNode createNodeElementClassAttribute(ElementClassAttribute eca) {
return new MaisDocNode(eca, eca.getId(), eca.getId(), eca.getDescription()); return new MaisDocNode(eca, eca.getId(), eca.getId(), eca.getDescription());
} }

View file

@ -54,11 +54,13 @@ public class EldDocWriterElementClass implements MaisDocContentPrinter {
@MaisDocNodeDataConfiguratorMethod(targetClasses = { ElementClass.class }) @MaisDocNodeDataConfiguratorMethod(targetClasses = { ElementClass.class })
public void configNavBar(MaisDoc doc, MaisDocNode node, MaisDocNodeData data) { public void configNavBar(MaisDoc doc, MaisDocNode node, MaisDocNodeData data) {
/* /*
//@formatter:off
ElementClass ec = (ElementClass)node.getUserData(); ElementClass ec = (ElementClass)node.getUserData();
Collection<ElementClassAttribute> list = ec.getElementClassAttributes(); Collection<ElementClassAttribute> list = ec.getElementClassAttributes();
if (list.isEmpty()) { if (list.isEmpty()) {
clearHrefContentGroupAlways(doc,"summary","attribute"); clearHrefContentGroupAlways(doc,"summary","attribute");
} }
//@formatter:om
*/ */
clearHrefContentGroup(doc,node,"summary","attribute",ElementClassAttribute.class); clearHrefContentGroup(doc,node,"summary","attribute",ElementClassAttribute.class);
clearHrefContentGroup(doc,node,"summary","configurator",ElementConfigurator.class); clearHrefContentGroup(doc,node,"summary","configurator",ElementConfigurator.class);
@ -80,6 +82,7 @@ public class EldDocWriterElementClass implements MaisDocContentPrinter {
} }
/* /*
//@formatter:off
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary") @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementX4OAttributeSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException { public void writeElementX4OAttributeSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
ElementClass ec = (ElementClass)event.getEventObject().getUserData(); ElementClass ec = (ElementClass)event.getEventObject().getUserData();
@ -95,9 +98,11 @@ public class EldDocWriterElementClass implements MaisDocContentPrinter {
} }
writer.docTableEnd(); writer.docTableEnd();
} }
//@formatter:on
*/ */
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={10},contentGroup="bean",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementClass.class }, nodeBodyOrders = {
10 }, contentGroup = "bean", contentGroupType = "summary")
public void writeElementObjectPropertiesSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException { public void writeElementObjectPropertiesSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ElementClass ec = (ElementClass) event.getEventObject().getUserData(); ElementClass ec = (ElementClass) event.getEventObject().getUserData();
Class<?> beanClass = ec.getObjectClass(); Class<?> beanClass = ec.getObjectClass();

View file

@ -53,23 +53,26 @@ public class EldDocWriterElementInterface implements MaisDocContentPrinter {
clearHrefContentGroup(doc, node, "summary", "configurator", ElementConfigurator.class); clearHrefContentGroup(doc, node, "summary", "configurator", ElementConfigurator.class);
} }
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementInterface.class }, nodeBodyOrders = {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary") 1 }, contentGroup = "interface", contentGroupType = "summary")
public void writeElementNamespaceBeanProperties(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeElementNamespaceBeanProperties(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event, "Interface", "description"); printApiTableBean(event, "Interface", "description");
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementInterface.class }, nodeBodyOrders = {
2 }, contentGroup = "attribute", contentGroupType = "summary")
public void writeElementClassAttribute(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeElementClassAttribute(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Element Class Attribute Summary", ElementClassAttribute.class); printApiTable(event, "Element Class Attribute Summary", ElementClassAttribute.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={3},contentGroup="binding",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementInterface.class }, nodeBodyOrders = {
3 }, contentGroup = "binding", contentGroupType = "summary")
public void writeElementBindingHandler(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeElementBindingHandler(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Element Binding Handler Summary", ElementBindingHandler.class); printApiTable(event, "Element Binding Handler Summary", ElementBindingHandler.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementInterface.class }, nodeBodyOrders = {
4 }, contentGroup = "configurator", contentGroupType = "summary")
public void writeElementConfigurator(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeElementConfigurator(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Element Configurator Summary", ElementConfigurator.class); printApiTable(event, "Element Configurator Summary", ElementConfigurator.class);
} }

View file

@ -49,12 +49,14 @@ public class EldDocWriterElementNamespace implements MaisDocContentPrinter {
clearHrefContentGroup(doc, node, "summary", "element", ElementClass.class); clearHrefContentGroup(doc, node, "summary", "element", ElementClass.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementNamespace.class }, nodeBodyOrders = {
1 }, contentGroup = "namespace", contentGroupType = "summary")
public void writeElementNamespaceBeanProperties(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeElementNamespaceBeanProperties(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event, "Namespace", "description", "elementClasses", "elementNamespaceInstanceProvider", "prefixMapping"); printApiTableBean(event, "Namespace", "description", "elementClasses", "elementNamespaceInstanceProvider", "prefixMapping");
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { ElementNamespace.class }, nodeBodyOrders = {
2 }, contentGroup = "element", contentGroupType = "summary")
public void writeElementNamespaceElements(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeElementNamespaceElements(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Element Summary", ElementClass.class); printApiTable(event, "Element Summary", ElementClass.class);
} }

View file

@ -65,7 +65,6 @@ public class EldDocWriterLanguage implements MaisDocContentPrinter {
printApiTableBean(event, "Element Class Attribute", "description"); printApiTableBean(event, "Element Class Attribute", "description");
} }
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguage.class }, nodeBodyOrders = { 1 }) @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguage.class }, nodeBodyOrders = { 1 })
public void writeLanguageSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeLanguageSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
MaisDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
@ -88,6 +87,7 @@ public class EldDocWriterLanguage implements MaisDocContentPrinter {
} }
} }
writer.docTableStart("Language Summary", "Language Stats Summary.", MaisDocContentCss.overviewSummary); writer.docTableStart("Language Summary", "Language Stats Summary.", MaisDocContentCss.overviewSummary);
//@formatter:off
writer.docTableHeader("Name", "Value"); writer.docTableHeader("Name", "Value");
writer.docTableRow("LanguageName:", ""+language.getLanguageName(), null); writer.docTableRow("LanguageName:", ""+language.getLanguageName(), null);
writer.docTableRow("LanguageVersion:",""+language.getLanguageVersion(),null); writer.docTableRow("LanguageVersion:",""+language.getLanguageVersion(),null);
@ -99,6 +99,7 @@ public class EldDocWriterLanguage implements MaisDocContentPrinter {
writer.docTableRow("ElementBindingHandlers:",""+bindHandlers,null); writer.docTableRow("ElementBindingHandlers:",""+bindHandlers,null);
writer.docTableRow("ElementConfigurators:",""+eleConfigs,null); writer.docTableRow("ElementConfigurators:",""+eleConfigs,null);
writer.docTableEnd(); writer.docTableEnd();
//@formatter:on
} }
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguage.class }, nodeBodyOrders = { 2 }) @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguage.class }, nodeBodyOrders = { 2 })
@ -115,7 +116,9 @@ public class EldDocWriterLanguage implements MaisDocContentPrinter {
writer.docTableHeader("ID", "URI"); writer.docTableHeader("ID", "URI");
for (X4OLanguageModule mod : language.getLanguageModules()) { for (X4OLanguageModule mod : language.getLanguageModules()) {
for (ElementNamespace ns : mod.getElementNamespaces()) { for (ElementNamespace ns : mod.getElementNamespaces()) {
writer.docTableRowLink("language/"+MaisDocContentWriter.toSafeUri(mod.getId())+"/"+MaisDocContentWriter.toSafeUri(ns.getId())+"/index.html",ns.getId(),ns.getUri()); writer.docTableRowLink(
"language/" + MaisDocContentWriter.toSafeUri(mod.getId()) + "/" + MaisDocContentWriter.toSafeUri(ns.getId()) + "/index.html",
ns.getId(), ns.getUri());
} }
} }
writer.docTableEnd(); writer.docTableEnd();

View file

@ -58,27 +58,32 @@ public class EldDocWriterLanguageModule implements MaisDocContentPrinter {
clearHrefContentGroup(doc, node, "summary", "namespace", ElementNamespace.class); clearHrefContentGroup(doc, node, "summary", "namespace", ElementNamespace.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguageModule.class }, nodeBodyOrders = {
1 }, contentGroup = "interface", contentGroupType = "summary")
public void writeInterfaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeInterfaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Interface Summary", ElementInterface.class); printApiTable(event, "Interface Summary", ElementInterface.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={2},contentGroup="binding",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguageModule.class }, nodeBodyOrders = {
2 }, contentGroup = "binding", contentGroupType = "summary")
public void writeBindingSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeBindingSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Binding Summary", ElementBindingHandler.class); printApiTable(event, "Binding Summary", ElementBindingHandler.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={3},contentGroup="attribute",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguageModule.class }, nodeBodyOrders = {
3 }, contentGroup = "attribute", contentGroupType = "summary")
public void writeAttributeSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeAttributeSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Attribute Summary", ElementNamespaceAttribute.class); printApiTable(event, "Attribute Summary", ElementNamespaceAttribute.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguageModule.class }, nodeBodyOrders = {
4 }, contentGroup = "configurator", contentGroupType = "summary")
public void writeConfigutorSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeConfigutorSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Configurator Summary", ElementConfigurator.class); printApiTable(event, "Configurator Summary", ElementConfigurator.class);
} }
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={5},contentGroup="namespace",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = { X4OLanguageModule.class }, nodeBodyOrders = {
5 }, contentGroup = "namespace", contentGroupType = "summary")
public void writeNamespaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException { public void writeNamespaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event, "Namespace Summary", ElementNamespace.class); printApiTable(event, "Namespace Summary", ElementNamespace.class);
} }

View file

@ -75,6 +75,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements Mais
/** /**
* TODO: remove this * TODO: remove this
*
* @see org.x4o.maisdoc.flake.DefaultPageWriterTree#writePageContent(org.x4o.maisdoc.model.MaisDocWriteEvent) * @see org.x4o.maisdoc.flake.DefaultPageWriterTree#writePageContent(org.x4o.maisdoc.model.MaisDocWriteEvent)
*/ */
@Override @Override
@ -107,6 +108,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements Mais
walkTree(rootNode, e.getWriter(), pathPrefix); walkTree(rootNode, e.getWriter(), pathPrefix);
} }
} }
private String toElementUri(String pathPrefix, X4OLanguageModule mod, ElementNamespace namespace, ElementClass ec) { private String toElementUri(String pathPrefix, X4OLanguageModule mod, ElementNamespace namespace, ElementClass ec) {
StringBuilder buf = new StringBuilder(100); StringBuilder buf = new StringBuilder(100);
if (pathPrefix != null) { if (pathPrefix != null) {
@ -121,9 +123,9 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements Mais
return buf.toString(); return buf.toString();
} }
/** /**
* Overrided to select the dom view of the tree. * Overrided to select the dom view of the tree.
*
* @see org.x4o.maisdoc.flake.DefaultPageWriterTree#selectRootNode(org.x4o.maisdoc.model.MaisDoc) * @see org.x4o.maisdoc.flake.DefaultPageWriterTree#selectRootNode(org.x4o.maisdoc.model.MaisDoc)
*/ */
@Override @Override
@ -161,7 +163,6 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements Mais
walkTree(rootNode, "../"); walkTree(rootNode, "../");
} }
return root; return root;
} }
@ -173,7 +174,6 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements Mais
} }
} }
class TreeNode { class TreeNode {
X4OLanguage language; X4OLanguage language;
X4OLanguageModule module; X4OLanguageModule module;
@ -247,9 +247,7 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements Mais
private boolean isInTree(TreeNode node, TreeNode checkNode) { private boolean isInTree(TreeNode node, TreeNode checkNode) {
if ( node.namespace.getUri().equals(checkNode.namespace.getUri()) && if (node.namespace.getUri().equals(checkNode.namespace.getUri()) && node.elementClass.getId().equals(checkNode.elementClass.getId())) {
node.elementClass.getId().equals(checkNode.elementClass.getId())
) {
return true; return true;
} }
if (node.parent != null) { if (node.parent != null) {

View file

@ -36,6 +36,7 @@ public class AttributeAliasElement extends AbstractElement {
/** /**
* Add the xml attribute 'name' to ElementClassAttribute as attribute alias. * Add the xml attribute 'name' to ElementClassAttribute as attribute alias.
*
* @see org.x4o.xml.element.AbstractElement#doElementEnd() * @see org.x4o.xml.element.AbstractElement#doElementEnd()
* @throws ElementException When name attribute is not set or when parent element object is not ElementClassAttribute interface. * @throws ElementException When name attribute is not set or when parent element object is not ElementClassAttribute interface.
*/ */

View file

@ -50,12 +50,15 @@ public class BeanElement extends AbstractElement {
/** /**
* On start of element create the element object, filled from the bean.class attribute. * On start of element create the element object, filled from the bean.class attribute.
*
* @throws ElementException When bean could not be created. * @throws ElementException When bean could not be created.
*/ */
@Override @Override
public void doElementStart() throws ElementException { public void doElementStart() throws ElementException {
String className = getAttributes().get("bean.class"); String className = getAttributes().get("bean.class");
if("".equals(className) | className==null) { throw new ElementException("Set the bean.class attribute"); } if ("".equals(className) | className == null) {
throw new ElementException("Set the bean.class attribute");
}
try { try {
Class<?> beanClass = X4OLanguageClassLoader.loadClass(className); Class<?> beanClass = X4OLanguageClassLoader.loadClass(className);
if (constructorArguments.isEmpty()) { if (constructorArguments.isEmpty()) {
@ -83,6 +86,7 @@ public class BeanElement extends AbstractElement {
/** /**
* Add bean constructor arguments. * Add bean constructor arguments.
*
* @param argu The argument to add to constructor. * @param argu The argument to add to constructor.
*/ */
public void addConstuctorArgument(Object argu) { public void addConstuctorArgument(Object argu) {

View file

@ -36,6 +36,7 @@ public class DescriptionElement extends AbstractElement {
/** /**
* Starts the description element and validates that it is not root and parent is meta base. * Starts the description element and validates that it is not root and parent is meta base.
*
* @throws ElementException When parent element object is not meta base object. * @throws ElementException When parent element object is not meta base object.
* @see org.x4o.xml.element.AbstractElement#doElementStart() * @see org.x4o.xml.element.AbstractElement#doElementStart()
*/ */
@ -51,6 +52,7 @@ public class DescriptionElement extends AbstractElement {
/** /**
* The description elememt body characters are stored as element object. * The description elememt body characters are stored as element object.
*
* @param characters The text of the description. * @param characters The text of the description.
* @throws ElementException When super has error. * @throws ElementException When super has error.
* @see org.x4o.xml.element.AbstractElement#doCharacters(java.lang.String) * @see org.x4o.xml.element.AbstractElement#doCharacters(java.lang.String)
@ -63,6 +65,7 @@ public class DescriptionElement extends AbstractElement {
/** /**
* Ends the description element and sets the description on the parent. * Ends the description element and sets the description on the parent.
*
* @throws ElementException When parent element object is not meta base object. * @throws ElementException When parent element object is not meta base object.
* @see org.x4o.xml.element.AbstractElement#doElementEnd() * @see org.x4o.xml.element.AbstractElement#doElementEnd()
*/ */

View file

@ -36,10 +36,7 @@ import org.x4o.xml.element.ElementClassAttribute;
*/ */
public class ElementClassAttributeBindingHandler extends AbstractElementBindingHandler<ElementClassAttribute> { public class ElementClassAttributeBindingHandler extends AbstractElementBindingHandler<ElementClassAttribute> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { ObjectConverter.class };
private final static Class<?>[] CLASSES_CHILD = new Class[] {
ObjectConverter.class
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()

View file

@ -30,18 +30,14 @@ import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementConfigurator; import org.x4o.xml.element.ElementConfigurator;
/** /**
* This ElementBindingHandler adds the ElementClassAttributeConverter and the * This ElementBindingHandler adds the ElementClassAttributeConverter and the ElementConfigurator to the ElementClass.
* ElementConfigurator to the ElementClass.
* *
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Jan 31, 2007 * @version 1.0 Jan 31, 2007
*/ */
public class ElementClassBindingHandler extends AbstractElementBindingHandler<ElementClass> { public class ElementClassBindingHandler extends AbstractElementBindingHandler<ElementClass> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { private final static Class<?>[] CLASSES_CHILD = new Class[] { ElementClassAttribute.class, ElementConfigurator.class };
ElementClassAttribute.class,
ElementConfigurator.class
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()

View file

@ -37,10 +37,7 @@ import org.x4o.xml.element.ElementInterface;
*/ */
public class ElementInterfaceBindingHandler extends AbstractElementBindingHandler<ElementInterface> { public class ElementInterfaceBindingHandler extends AbstractElementBindingHandler<ElementInterface> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { private final static Class<?>[] CLASSES_CHILD = new Class[] { ElementClassAttribute.class, ElementConfigurator.class };
ElementClassAttribute.class,
ElementConfigurator.class
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()

View file

@ -46,13 +46,8 @@ import org.x4o.xml.lang.X4OLanguageModuleLocal;
*/ */
public class ElementModuleBindingHandler extends AbstractElementBindingHandler<X4OLanguageModuleLocal> { public class ElementModuleBindingHandler extends AbstractElementBindingHandler<X4OLanguageModuleLocal> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { private final static Class<?>[] CLASSES_CHILD = new Class[] { ElementInterface.class, ElementNamespace.class, ElementBindingHandler.class,
ElementInterface.class, ElementConfiguratorGlobal.class, };
ElementNamespace.class,
ElementBindingHandler.class,
ElementConfiguratorGlobal.class,
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()
@ -96,42 +91,38 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler<
if (elementNamespace.getId() != null) { if (elementNamespace.getId() != null) {
StringBuilder buf = new StringBuilder(30); StringBuilder buf = new StringBuilder(30);
for (char c : elementNamespace.getId().toLowerCase().toCharArray()) { for (char c : elementNamespace.getId().toLowerCase().toCharArray()) {
if (Character.isLetter(c)) {buf.append(c);} if (Character.isLetter(c)) {
if (Character.isDigit(c)) {buf.append(c);} buf.append(c);
if ('-'==c) {buf.append(c);} }
if (Character.isDigit(c)) {
buf.append(c);
}
if ('-' == c) {
buf.append(c);
}
} }
String id = buf.toString(); String id = buf.toString();
elementNamespace.setId(id); elementNamespace.setId(id);
} }
if (elementNamespace.getUri() == null) { if (elementNamespace.getUri() == null) {
elementNamespace.setUri( elementNamespace.setUri(
"http://"+languageModule.getProviderHost()+ "http://" + languageModule.getProviderHost() + "/xml/ns/" + x4oParsingContext.getLanguageName() + "-" + elementNamespace.getId());
"/xml/ns/"+x4oParsingContext.getLanguageName()+
"-"+elementNamespace.getId());
} }
if (elementNamespace.getSchemaUri() == null) { if (elementNamespace.getSchemaUri() == null) {
elementNamespace.setSchemaUri( elementNamespace.setSchemaUri("http://" + languageModule.getProviderHost() + "/xml/ns/" + x4oParsingContext.getLanguageName() + "-"
"http://"+languageModule.getProviderHost()+ + elementNamespace.getId() + "-" + x4oParsingContext.getLanguageVersion() + ".xsd");
"/xml/ns/"+x4oParsingContext.getLanguageName()+
"-"+elementNamespace.getId()+
"-"+x4oParsingContext.getLanguageVersion()+
".xsd"
);
} }
if (elementNamespace.getSchemaResource() == null) { if (elementNamespace.getSchemaResource() == null) {
elementNamespace.setSchemaResource( elementNamespace.setSchemaResource(
x4oParsingContext.getLanguageName()+ x4oParsingContext.getLanguageName() + "-" + elementNamespace.getId() + "-" + x4oParsingContext.getLanguageVersion() + ".xsd");
"-"+elementNamespace.getId()+
"-"+x4oParsingContext.getLanguageVersion()+
".xsd"
);
} }
if (elementNamespace.getSchemaPrefix() == null) { if (elementNamespace.getSchemaPrefix() == null) {
elementNamespace.setSchemaPrefix(elementNamespace.getId()); elementNamespace.setSchemaPrefix(elementNamespace.getId());
} }
try { try {
elementNamespace.setElementNamespaceInstanceProvider(X4OLanguageClassLoader.newInstance(ElementNamespaceInstanceProvider.class, childElement.getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider())); elementNamespace.setElementNamespaceInstanceProvider(X4OLanguageClassLoader.newInstance(ElementNamespaceInstanceProvider.class,
childElement.getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementNamespaceInstanceProvider()));
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
throw new ElementBindingHandlerException("Error loading: " + e.getMessage(), e); throw new ElementBindingHandlerException("Error loading: " + e.getMessage(), e);
} }

View file

@ -37,10 +37,7 @@ import org.x4o.xml.element.ElementNamespaceAttribute;
*/ */
public class ElementNamespaceBindingHandler extends AbstractElementBindingHandler<ElementNamespace> { public class ElementNamespaceBindingHandler extends AbstractElementBindingHandler<ElementNamespace> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { private final static Class<?>[] CLASSES_CHILD = new Class[] { ElementClass.class, ElementNamespaceAttribute.class };
ElementClass.class,
ElementNamespaceAttribute.class
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()

View file

@ -85,7 +85,8 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
dataCollection.add(childObject); dataCollection.add(childObject);
return; return;
} }
throw new ElementBindingHandlerException("Unhandled property collection type: "+data.getClass()+" on: "+parentObject.getClass()+" id:"+getId()); throw new ElementBindingHandlerException(
"Unhandled property collection type: " + data.getClass() + " on: " + parentObject.getClass() + " id:" + getId());
} }
childElement.getLanguageSession().getElementObjectPropertyValue().setProperty(parentObject, property, childObject); childElement.getLanguageSession().getElementObjectPropertyValue().setProperty(parentObject, property, childObject);
@ -149,7 +150,8 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
try { try {
result = m.invoke(parentObject, new Object[] {}); result = m.invoke(parentObject, new Object[] {});
} catch (Exception e) { } catch (Exception e) {
throw new ElementBindingHandlerException("Invoke error: "+e.getMessage()+" from: "+getMethod+" on: "+parentObject+" id:"+getId(),e); throw new ElementBindingHandlerException("Invoke error: " + e.getMessage() + " from: " + getMethod + " on: " + parentObject + " id:" + getId(),
e);
} }
createSafeChildLoop(parentElement, result); createSafeChildLoop(parentElement, result);
return; return;
@ -181,12 +183,14 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
createSafeChild(parentElement, result); createSafeChild(parentElement, result);
return; return;
} else { } else {
throw new ElementBindingHandlerException("Unsupported return type: "+result.getClass()+" need: "+childClass+" from: "+getMethod+" on: "+parentElement.getElementObject().getClass()+" id:"+getId()); throw new ElementBindingHandlerException("Unsupported return type: " + result.getClass() + " need: " + childClass + " from: " + getMethod + " on: "
+ parentElement.getElementObject().getClass() + " id:" + getId());
} }
} }
/** /**
* Only create child when class matches and regex doesn't exclude it. * Only create child when class matches and regex doesn't exclude it.
*
* @param parentElement The element to create childeren for. * @param parentElement The element to create childeren for.
* @param childObject The childObject. * @param childObject The childObject.
*/ */

View file

@ -36,10 +36,7 @@ import org.x4o.xml.element.ElementBindingHandlerException;
*/ */
public class StringSplitConverterBindingHandler extends AbstractElementBindingHandler<StringSplitConverter> { public class StringSplitConverterBindingHandler extends AbstractElementBindingHandler<StringSplitConverter> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { StringSplitConverterStep.class };
private final static Class<?>[] CLASSES_CHILD = new Class[] {
StringSplitConverterStep.class
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()

View file

@ -36,10 +36,7 @@ import org.x4o.xml.element.ElementBindingHandlerException;
*/ */
public class StringSplitConverterStepBindingHandler extends AbstractElementBindingHandler<StringSplitConverterStep> { public class StringSplitConverterStepBindingHandler extends AbstractElementBindingHandler<StringSplitConverterStep> {
private final static Class<?>[] CLASSES_CHILD = new Class[] { ObjectConverter.class };
private final static Class<?>[] CLASSES_CHILD = new Class[] {
ObjectConverter.class
};
/** /**
* @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass() * @see org.x4o.xml.element.ElementBindingHandler#getBindParentClass()

View file

@ -49,6 +49,7 @@ public class EldXsdWriter {
private final static String PROPERTY_CONTEXT_PREFIX = SAX3PropertyConfig.X4O_PROPERTIES_PREFIX + "eld-xsd/"; private final static String PROPERTY_CONTEXT_PREFIX = SAX3PropertyConfig.X4O_PROPERTIES_PREFIX + "eld-xsd/";
public final static SAX3PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static SAX3PropertyConfig DEFAULT_PROPERTY_CONFIG;
//@formatter:off
public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path"; public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path";
public final static String OUTPUT_DOCUMENTATION = PROPERTY_CONTEXT_PREFIX+"output/documentation"; public final static String OUTPUT_DOCUMENTATION = PROPERTY_CONTEXT_PREFIX+"output/documentation";
public final static String FILTER_NAMESPACE = PROPERTY_CONTEXT_PREFIX+"filter/namespace"; public final static String FILTER_NAMESPACE = PROPERTY_CONTEXT_PREFIX+"filter/namespace";
@ -78,6 +79,7 @@ public class EldXsdWriter {
new PropertyConfigItem(PROLOG_XMLNS_DESC_ENABLE, Boolean.class, true) new PropertyConfigItem(PROLOG_XMLNS_DESC_ENABLE, Boolean.class, true)
); );
} }
//@formatter:on
private final X4OLanguage language; private final X4OLanguage language;
private final SAX3PropertyConfig propertyConfig; private final SAX3PropertyConfig propertyConfig;

View file

@ -146,7 +146,6 @@ public class EldXsdWriterElement {
} }
} }
private static final String COMMENT_FORMAT = "%1$-20s %2$s"; private static final String COMMENT_FORMAT = "%1$-20s %2$s";
private void prologWriteGenerator() throws IOException { private void prologWriteGenerator() throws IOException {
@ -440,7 +439,6 @@ public class EldXsdWriterElement {
} }
} }
public void writeElement(ElementClass ec, ElementNamespace nsWrite) throws IOException { public void writeElement(ElementClass ec, ElementNamespace nsWrite) throws IOException {
if (nsWrite.getLanguageRoot() != null && nsWrite.getLanguageRoot()) { if (nsWrite.getLanguageRoot() != null && nsWrite.getLanguageRoot()) {
return; // is done in writeElementClass return; // is done in writeElementClass

View file

@ -87,6 +87,7 @@ public abstract class AbstractElement implements Element {
/** /**
* Cleans the attributes and elements(class) and context. * Cleans the attributes and elements(class) and context.
*
* @see Element#release() * @see Element#release()
*/ */
public void release() throws ElementException { public void release() throws ElementException {
@ -132,7 +133,8 @@ public abstract class AbstractElement implements Element {
*/ */
public void doCharacters(String characters) throws ElementException { public void doCharacters(String characters) throws ElementException {
try { try {
Element e = X4OLanguageClassLoader.newInstance(Element.class, getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementBodyCharacters()); Element e = X4OLanguageClassLoader.newInstance(Element.class,
getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementBodyCharacters());
e.setElementObject(characters); e.setElementObject(characters);
addChild(e); addChild(e);
} catch (ClassNotFoundException exception) { } catch (ClassNotFoundException exception) {
@ -145,7 +147,8 @@ public abstract class AbstractElement implements Element {
*/ */
public void doComment(String comment) throws ElementException { public void doComment(String comment) throws ElementException {
try { try {
Element e = X4OLanguageClassLoader.newInstance(Element.class, getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementBodyComment()); Element e = X4OLanguageClassLoader.newInstance(Element.class,
getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementBodyComment());
e.setElementObject(comment); e.setElementObject(comment);
addChild(e); addChild(e);
} catch (ClassNotFoundException exception) { } catch (ClassNotFoundException exception) {
@ -158,7 +161,8 @@ public abstract class AbstractElement implements Element {
*/ */
public void doIgnorableWhitespace(String space) throws ElementException { public void doIgnorableWhitespace(String space) throws ElementException {
try { try {
Element e = X4OLanguageClassLoader.newInstance(Element.class, getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementBodyWhitespace()); Element e = X4OLanguageClassLoader.newInstance(Element.class,
getLanguageSession().getLanguage().getLanguageConfiguration().getDefaultElementBodyWhitespace());
e.setElementObject(space); e.setElementObject(space);
addChild(e); addChild(e);
} catch (ClassNotFoundException exception) { } catch (ClassNotFoundException exception) {
@ -235,6 +239,7 @@ public abstract class AbstractElement implements Element {
/** /**
* Defaults to false. * Defaults to false.
*
* @see org.x4o.xml.element.Element#isTransformingTree() * @see org.x4o.xml.element.Element#isTransformingTree()
*/ */
public boolean isTransformingTree() { public boolean isTransformingTree() {

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* An AbstractElementBindingHandler.<br> * An AbstractElementBindingHandler.<br>
* Does nothing. * Does nothing.
@ -54,7 +53,8 @@ public abstract class AbstractElementBindingHandler<T> extends AbstractElementMe
if (parentElement == null) { if (parentElement == null) {
throw new NullPointerException("Can't create child with null parent."); throw new NullPointerException("Can't create child with null parent.");
} }
Element childElement = parentElement.getLanguageSession().getLanguage().createElementInstance(parentElement.getLanguageSession(), childObject.getClass()); Element childElement = parentElement.getLanguageSession().getLanguage().createElementInstance(parentElement.getLanguageSession(),
childObject.getClass());
if (childElement == null) { if (childElement == null) {
throw new NullPointerException("Could not find Element for child: " + childObject.getClass()); throw new NullPointerException("Could not find Element for child: " + childObject.getClass());
} }

View file

@ -54,6 +54,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Returns the objectConverter. * Returns the objectConverter.
*
* @return The objectConverter. * @return The objectConverter.
*/ */
public ObjectConverter getObjectConverter() { public ObjectConverter getObjectConverter() {
@ -62,6 +63,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Sets the objectConverter. * Sets the objectConverter.
*
* @param objectConverter The objectConverter to set. * @param objectConverter The objectConverter to set.
*/ */
public void setObjectConverter(ObjectConverter objectConverter) { public void setObjectConverter(ObjectConverter objectConverter) {
@ -70,6 +72,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Sets the default value. * Sets the default value.
*
* @param defaultValue The defaultValue to set. * @param defaultValue The defaultValue to set.
* @see org.x4o.xml.element.ElementClassAttribute#setDefaultValue(java.lang.Object) * @see org.x4o.xml.element.ElementClassAttribute#setDefaultValue(java.lang.Object)
*/ */
@ -79,6 +82,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Returns the default value. * Returns the default value.
*
* @return The default value. * @return The default value.
* @see org.x4o.xml.element.ElementClassAttribute#getDefaultValue() * @see org.x4o.xml.element.ElementClassAttribute#getDefaultValue()
*/ */
@ -88,6 +92,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Adds an alias of this attribute. * Adds an alias of this attribute.
*
* @param alias The alias to add. * @param alias The alias to add.
* @see org.x4o.xml.element.ElementClassAttribute#addAttributeAlias(java.lang.String) * @see org.x4o.xml.element.ElementClassAttribute#addAttributeAlias(java.lang.String)
*/ */
@ -97,6 +102,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Removes an alias of this attribute. * Removes an alias of this attribute.
*
* @param alias The alias to remove. * @param alias The alias to remove.
* @see org.x4o.xml.element.ElementClassAttribute#removeAttributeAlias(java.lang.String) * @see org.x4o.xml.element.ElementClassAttribute#removeAttributeAlias(java.lang.String)
*/ */
@ -106,6 +112,7 @@ public abstract class AbstractElementClassAttribute extends AbstractElementMetaB
/** /**
* Returns all aliases of this attribute. * Returns all aliases of this attribute.
*
* @return An list of aliases. * @return An list of aliases.
* @see org.x4o.xml.element.ElementClassAttribute#getAttributeAliases() * @see org.x4o.xml.element.ElementClassAttribute#getAttributeAliases()
*/ */

View file

@ -51,6 +51,7 @@ public abstract class AbstractElementClassBase extends AbstractElementMetaBase i
/** /**
* Returns a list of ElementConfigurators. * Returns a list of ElementConfigurators.
*
* @return List of ElementConfigurators. * @return List of ElementConfigurators.
* @see ElementClass#getElementConfigurators() * @see ElementClass#getElementConfigurators()
*/ */
@ -82,6 +83,7 @@ public abstract class AbstractElementClassBase extends AbstractElementMetaBase i
/** /**
* Get the ElementClassAttribute from its name. * Get the ElementClassAttribute from its name.
*
* @param attributeName The attribute name. * @param attributeName The attribute name.
* @return The element class attribute for the name. * @return The element class attribute for the name.
*/ */
@ -91,6 +93,7 @@ public abstract class AbstractElementClassBase extends AbstractElementMetaBase i
/** /**
* Adds parent tag. * Adds parent tag.
*
* @see org.x4o.xml.element.ElementClassBase#addElementParent(java.lang.String,java.lang.String) * @see org.x4o.xml.element.ElementClassBase#addElementParent(java.lang.String,java.lang.String)
* @param namespaceUri The namespace uri of the parent tag. * @param namespaceUri The namespace uri of the parent tag.
* @param tag The tag of the parent of this tag. * @param tag The tag of the parent of this tag.
@ -112,6 +115,7 @@ public abstract class AbstractElementClassBase extends AbstractElementMetaBase i
/** /**
* Removes parent tag. * Removes parent tag.
*
* @see org.x4o.xml.element.ElementClassBase#removeElementParent(java.lang.String,java.lang.String) * @see org.x4o.xml.element.ElementClassBase#removeElementParent(java.lang.String,java.lang.String)
* @param namespaceUri The namespace uri of the parent tag. * @param namespaceUri The namespace uri of the parent tag.
* @param tag The tag of the parent of this tag. * @param tag The tag of the parent of this tag.
@ -126,6 +130,7 @@ public abstract class AbstractElementClassBase extends AbstractElementMetaBase i
/** /**
* Returns the parent per namespace uri. * Returns the parent per namespace uri.
*
* @see org.x4o.xml.element.ElementClassBase#getElementParents(java.lang.String) * @see org.x4o.xml.element.ElementClassBase#getElementParents(java.lang.String)
* @param namespaceUri The namespace uri to gets the parents of. * @param namespaceUri The namespace uri to gets the parents of.
* @return List of parent tags of requested parent namespace uri. * @return List of parent tags of requested parent namespace uri.

View file

@ -36,6 +36,7 @@ public abstract class AbstractElementConfigurator extends AbstractElementMetaBas
/** /**
* Defaults to false. * Defaults to false.
*
* @see org.x4o.xml.element.ElementConfigurator#isConfigAction() * @see org.x4o.xml.element.ElementConfigurator#isConfigAction()
* @return True if set to configAction * @return True if set to configAction
*/ */
@ -45,6 +46,7 @@ public abstract class AbstractElementConfigurator extends AbstractElementMetaBas
/** /**
* Sets the configAction. * Sets the configAction.
*
* @param configAction The configAction to set. * @param configAction The configAction to set.
*/ */
public void setConfigAction(boolean configAction) { public void setConfigAction(boolean configAction) {

View file

@ -39,6 +39,7 @@ public abstract class AbstractElementMetaBase implements ElementMetaBase {
/** /**
* Gets the id. * Gets the id.
*
* @see org.x4o.xml.element.ElementMetaBase#getId() * @see org.x4o.xml.element.ElementMetaBase#getId()
* @return The id. * @return The id.
*/ */
@ -48,6 +49,7 @@ public abstract class AbstractElementMetaBase implements ElementMetaBase {
/** /**
* Sets the id. * Sets the id.
*
* @see org.x4o.xml.element.ElementMetaBase#setId(java.lang.String) * @see org.x4o.xml.element.ElementMetaBase#setId(java.lang.String)
* @param id The id to set. * @param id The id to set.
*/ */
@ -57,6 +59,7 @@ public abstract class AbstractElementMetaBase implements ElementMetaBase {
/** /**
* Gets the description. * Gets the description.
*
* @see org.x4o.xml.element.ElementConfigurator#getDescription() * @see org.x4o.xml.element.ElementConfigurator#getDescription()
* @return The description. * @return The description.
*/ */
@ -66,6 +69,7 @@ public abstract class AbstractElementMetaBase implements ElementMetaBase {
/** /**
* Sets the description. * Sets the description.
*
* @see org.x4o.xml.element.ElementConfigurator#setDescription(java.lang.String) * @see org.x4o.xml.element.ElementConfigurator#setDescription(java.lang.String)
* @param description The description to set. * @param description The description to set.
*/ */

View file

@ -187,7 +187,6 @@ public abstract class AbstractElementNamespace extends AbstractElementMetaBase i
this.schemaPrefix = schemaPrefix; this.schemaPrefix = schemaPrefix;
} }
public void addElementNamespaceAttribute(ElementNamespaceAttribute elementNamespaceAttribute) { public void addElementNamespaceAttribute(ElementNamespaceAttribute elementNamespaceAttribute) {
if (elementNamespaceAttribute == null) { if (elementNamespaceAttribute == null) {
throw new NullPointerException("Can't add null object"); throw new NullPointerException("Can't add null object");

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* The default element to handle the xml events. * The default element to handle the xml events.
* *

View file

@ -29,7 +29,6 @@ import javax.el.ValueExpression;
import org.x4o.xml.conv.ObjectConverterException; import org.x4o.xml.conv.ObjectConverterException;
/** /**
* An DefaultElementAttributeValueParser. * An DefaultElementAttributeValueParser.
* *
@ -38,14 +37,12 @@ import org.x4o.xml.conv.ObjectConverterException;
*/ */
public class DefaultElementAttributeValueParser implements ElementAttributeValueParser { public class DefaultElementAttributeValueParser implements ElementAttributeValueParser {
private Logger logger = null; private Logger logger = null;
public DefaultElementAttributeValueParser() { public DefaultElementAttributeValueParser() {
logger = Logger.getLogger(DefaultElementAttributeValueParser.class.getName()); logger = Logger.getLogger(DefaultElementAttributeValueParser.class.getName());
} }
/** /**
* @see org.x4o.xml.element.ElementAttributeValueParser#getParameterValue(java.lang.String, java.lang.String, org.x4o.xml.element.Element) * @see org.x4o.xml.element.ElementAttributeValueParser#getParameterValue(java.lang.String, java.lang.String, org.x4o.xml.element.Element)
*/ */
@ -58,9 +55,6 @@ public class DefaultElementAttributeValueParser implements ElementAttributeValue
return getConvertedParameterValue(name, value, element); return getConvertedParameterValue(name, value, element);
} }
/** /**
* @throws ObjectConverterException * @throws ObjectConverterException
* @see org.x4o.xml.element.ElementAttributeValueParser#getConvertedParameterValue(java.lang.String, java.lang.Object, org.x4o.xml.element.Element) * @see org.x4o.xml.element.ElementAttributeValueParser#getConvertedParameterValue(java.lang.String, java.lang.Object, org.x4o.xml.element.Element)
@ -106,7 +100,8 @@ public class DefaultElementAttributeValueParser implements ElementAttributeValue
* @see org.x4o.xml.element.ElementAttributeValueParser#getELParameterValue(java.lang.String, org.x4o.xml.element.Element) * @see org.x4o.xml.element.ElementAttributeValueParser#getELParameterValue(java.lang.String, org.x4o.xml.element.Element)
*/ */
public Object getELParameterValue(String value, Element element) throws ElementAttributeValueParserException { public Object getELParameterValue(String value, Element element) throws ElementAttributeValueParserException {
ValueExpression e = element.getLanguageSession().getExpressionLanguageFactory().createValueExpression(element.getLanguageSession().getExpressionLanguageContext(), (String)value,Object.class); ValueExpression e = element.getLanguageSession().getExpressionLanguageFactory()
.createValueExpression(element.getLanguageSession().getExpressionLanguageContext(), (String) value, Object.class);
return e.getValue(element.getLanguageSession().getExpressionLanguageContext()); return e.getValue(element.getLanguageSession().getExpressionLanguageContext());
} }

View file

@ -29,7 +29,6 @@ import java.util.Map;
import org.x4o.xml.lang.X4OLanguageSession; import org.x4o.xml.lang.X4OLanguageSession;
/** /**
* DefaultElementBodyCharacters the default characters element. * DefaultElementBodyCharacters the default characters element.
* *

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* DefaultElementBodyComment the default comment element. * DefaultElementBodyComment the default comment element.
* *

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* DefaultElementBodyWhitespace the default white space element. * DefaultElementBodyWhitespace the default white space element.
* *

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* DefaultElementClass stores the XML Element information. * DefaultElementClass stores the XML Element information.
* *

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* The default ElementClassAttribute. * The default ElementClassAttribute.
* *

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* The default ElementInterface to store config based on class interface. * The default ElementInterface to store config based on class interface.
* *

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* DefaultElementNamespace is the default element namespace implementation. * DefaultElementNamespace is the default element namespace implementation.
* *

View file

@ -24,8 +24,6 @@ package org.x4o.xml.element;
import java.util.Comparator; import java.util.Comparator;
/** /**
* The DefaultElementNamespaceAttributeComparator.<br> * The DefaultElementNamespaceAttributeComparator.<br>
* This Comparator compares the NextAttribute names with the attributeName of the ElementNamespaceAttribute.<br> * This Comparator compares the NextAttribute names with the attributeName of the ElementNamespaceAttribute.<br>

View file

@ -144,7 +144,6 @@ public class DefaultElementObjectPropertyValue implements ElementObjectPropertyV
// Invoke for native based types // Invoke for native based types
// not found 2sec try // not found 2sec try
logger.finest("No corresoning class is found, trying convert manualy"); logger.finest("No corresoning class is found, trying convert manualy");
@ -180,16 +179,7 @@ public class DefaultElementObjectPropertyValue implements ElementObjectPropertyV
/* /*
* JAVA NATIVE TYPES: * JAVA NATIVE TYPES:
* *
* TYPE: Size in bits: * TYPE: Size in bits: boolean 8, unsigned byte 8 char 16, unsigned short 16 int 32 long 64 float 32 double 64 void n/a
* boolean 8, unsigned
* byte 8
* char 16, unsigned
* short 16
* int 32
* long 64
* float 32
* double 64
* void n/a
*/ */
if (lastMethod.getParameterTypes()[0].isAssignableFrom(Boolean.TYPE)) { if (lastMethod.getParameterTypes()[0].isAssignableFrom(Boolean.TYPE)) {
conv = convProvider.getObjectConverterForClass(Boolean.class); conv = convProvider.getObjectConverterForClass(Boolean.class);

View file

@ -32,8 +32,7 @@ import org.x4o.xml.lang.X4OLanguageSession;
* Defines an XML element with an object.<br> * Defines an XML element with an object.<br>
* <br> * <br>
* The main function is to store the ElementObject.<br> * The main function is to store the ElementObject.<br>
* Also we can configure the ElementObject from differted events hooks. * Also we can configure the ElementObject from differted events hooks. from the attibutes or parent (object)element.
* from the attibutes or parent (object)element.
* *
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Feb 01, 2005 * @version 1.0 Feb 01, 2005
@ -62,6 +61,7 @@ public interface Element {
/** /**
* Filters the given elments list to elementType. * Filters the given elments list to elementType.
*
* @param elements The elements to filter. * @param elements The elements to filter.
* @param elementType The elementType to filter on. * @param elementType The elementType to filter on.
* @return Always returns List of Elements of filter type. * @return Always returns List of Elements of filter type.
@ -80,24 +80,28 @@ public interface Element {
/** /**
* This method is fired when the end xml tag is parsed. * This method is fired when the end xml tag is parsed.
*
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
void doElementEnd() throws ElementException; void doElementEnd() throws ElementException;
/** /**
* This method is fired when the start of xml tag is parsed. * This method is fired when the start of xml tag is parsed.
*
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
void doElementStart() throws ElementException; void doElementStart() throws ElementException;
/** /**
* This method is fired only once in the run phase. * This method is fired only once in the run phase.
*
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
void doElementRun() throws ElementException; void doElementRun() throws ElementException;
/** /**
* Set the parent Element. * Set the parent Element.
*
* @param element The paraent Element to set. * @param element The paraent Element to set.
*/ */
void setParent(Element element); void setParent(Element element);
@ -113,6 +117,7 @@ public interface Element {
/** /**
* This method get called when this Element object is not needed anymore.<br> * This method get called when this Element object is not needed anymore.<br>
* Can be used to close resources. * Can be used to close resources.
*
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
void release() throws ElementException; void release() throws ElementException;
@ -127,24 +132,28 @@ public interface Element {
/** /**
* Sets the object which we control. * Sets the object which we control.
*
* @param object The object to configed by this element. * @param object The object to configed by this element.
*/ */
void setElementObject(Object object); void setElementObject(Object object);
/** /**
* Sets the X4OLanguageSession. * Sets the X4OLanguageSession.
*
* @param languageSession The X4OLanguageSession to set. * @param languageSession The X4OLanguageSession to set.
*/ */
void setLanguageSession(X4OLanguageSession languageSession); void setLanguageSession(X4OLanguageSession languageSession);
/** /**
* Gets the X4OLanguageSession. * Gets the X4OLanguageSession.
*
* @return Returns the X4OLanguageSession. * @return Returns the X4OLanguageSession.
*/ */
X4OLanguageSession getLanguageSession(); X4OLanguageSession getLanguageSession();
/** /**
* Sets the body texts on an event based system. * Sets the body texts on an event based system.
*
* @param body The body text. * @param body The body text.
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
@ -152,6 +161,7 @@ public interface Element {
/** /**
* Sets the comment texts on an event based system. * Sets the comment texts on an event based system.
*
* @param comment The comment text. * @param comment The comment text.
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
@ -159,6 +169,7 @@ public interface Element {
/** /**
* Is called when there is whitespace in xml. * Is called when there is whitespace in xml.
*
* @param space The space. * @param space The space.
* @throws ElementException Can be thrown when structure is not correct. * @throws ElementException Can be thrown when structure is not correct.
*/ */
@ -166,18 +177,21 @@ public interface Element {
/** /**
* Sets the ElementClass. * Sets the ElementClass.
*
* @param elementClass The ElementClass to set. * @param elementClass The ElementClass to set.
*/ */
void setElementClass(ElementClass elementClass); void setElementClass(ElementClass elementClass);
/** /**
* Gets the ElementClass. * Gets the ElementClass.
*
* @return Returns the ElementClass. * @return Returns the ElementClass.
*/ */
ElementClass getElementClass(); ElementClass getElementClass();
/** /**
* Sets the xml attributes. * Sets the xml attributes.
*
* @param name The name to set. * @param name The name to set.
* @param value The value to set. * @param value The value to set.
*/ */
@ -185,43 +199,48 @@ public interface Element {
/** /**
* Gets the xml attributes. * Gets the xml attributes.
*
* @return Returns the xml attributes. * @return Returns the xml attributes.
*/ */
Map<String, String> getAttributes(); Map<String, String> getAttributes();
/** /**
* Gets the childeren elements. * Gets the childeren elements.
*
* @return Returns the childeren. * @return Returns the childeren.
*/ */
List<Element> getChilderen(); List<Element> getChilderen();
/** /**
* Gets the childeren elements including those which are comment and white space. (text) * Gets the childeren elements including those which are comment and white space. (text)
*
* @return Returns all the childeren. * @return Returns all the childeren.
*/ */
List<Element> getAllChilderen(); List<Element> getAllChilderen();
/** /**
* Adds an Elment as child of this element. * Adds an Elment as child of this element.
*
* @param element The child to add. * @param element The child to add.
*/ */
void addChild(Element element); void addChild(Element element);
/** /**
* Removes an Elment as child of this element. * Removes an Elment as child of this element.
*
* @param element The child to remove. * @param element The child to remove.
*/ */
void removeChild(Element element); void removeChild(Element element);
/** /**
* Gets the Element type. * Gets the Element type.
*
* @return Returns the ElementType. * @return Returns the ElementType.
*/ */
ElementType getElementType(); ElementType getElementType();
/** /**
* Returns if this elements transforms the tree. * Returns if this elements transforms the tree. if true the the doElementRun is runned in the transform phase insteat of the run phase.
* if true the the doElementRun is runned in the transform phase insteat of the run phase.
* *
* You need to add those new or modified Elements to the DirtyElement for reparsering. * You need to add those new or modified Elements to the DirtyElement for reparsering.
* *

View file

@ -34,6 +34,7 @@ public interface ElementAttributeValueParser {
/** /**
* Checks if the value is an EL parameter. * Checks if the value is an EL parameter.
*
* @param name The name of the attribute. * @param name The name of the attribute.
* @param value The value of the attribute. * @param value The value of the attribute.
* @param element The element of the attribute. * @param element The element of the attribute.
@ -43,6 +44,7 @@ public interface ElementAttributeValueParser {
/** /**
* Returns the object which is stored in the ELContext * Returns the object which is stored in the ELContext
*
* @param value The attribute value. * @param value The attribute value.
* @param element The element of the attribute. * @param element The element of the attribute.
* @return Returns the resolved el parameter value. * @return Returns the resolved el parameter value.
@ -53,6 +55,7 @@ public interface ElementAttributeValueParser {
/** /**
* Convert the value into a new value genereted by parameterConverters. * Convert the value into a new value genereted by parameterConverters.
*
* @param name The name of the attribute. * @param name The name of the attribute.
* @param value The value of the attribute. * @param value The value of the attribute.
* @param element The element of the attribute. * @param element The element of the attribute.
@ -63,8 +66,8 @@ public interface ElementAttributeValueParser {
Object getConvertedParameterValue(String name, Object value, Element element) throws ElementAttributeValueParserException, ObjectConverterException; Object getConvertedParameterValue(String name, Object value, Element element) throws ElementAttributeValueParserException, ObjectConverterException;
/** /**
* Does is all, Checks if value is EL parameter and lookups the object. * Does is all, Checks if value is EL parameter and lookups the object. and converts to new object via parameter converter and return value.
* and converts to new object via parameter converter and return value. *
* @param name The name of the attribute. * @param name The name of the attribute.
* @param value The value of the attribute. * @param value The value of the attribute.
* @param element The element of the attribute. * @param element The element of the attribute.

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* ElementAttributeValueParserException.<br> * ElementAttributeValueParserException.<br>
* *
@ -35,12 +34,8 @@ package org.x4o.xml.element;
public class ElementAttributeValueParserException extends ElementException { public class ElementAttributeValueParserException extends ElementException {
/* /*
public ElementAttributeValueParserException(ElementAttributeConverter converter,String message) { * public ElementAttributeValueParserException(ElementAttributeConverter converter,String message) { super(message); }
super(message); *
} * public ElementAttributeValueParserException(ElementAttributeConverter converter,String message,Exception exception) { super(message,exception); }
public ElementAttributeValueParserException(ElementAttributeConverter converter,String message,Exception exception) {
super(message,exception);
}
*/ */
} }

View file

@ -22,13 +22,11 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* Bind ElementObjects together. * Bind ElementObjects together.
* *
* This interface is used to bind a parent and child ElementObject together. * This interface is used to bind a parent and child ElementObject together. For example; when both objects are an JComponent then we can add the child to the
* For example; when both objects are an JComponent then we can add the child to the parent * parent with the method: ((JComponent)parent).add((JComponent)child);
* with the method: ((JComponent)parent).add((JComponent)child);
* *
* *
* @author Willem Cazander * @author Willem Cazander
@ -48,6 +46,7 @@ public interface ElementBindingHandler extends ElementMetaBase {
/** /**
* Do the binding of this child to the parent object. * Do the binding of this child to the parent object.
*
* @param childElement The child element to bind to the parent.' * @param childElement The child element to bind to the parent.'
* @throws ElementBindingHandlerException When binding could not happen. * @throws ElementBindingHandlerException When binding could not happen.
*/ */
@ -55,6 +54,7 @@ public interface ElementBindingHandler extends ElementMetaBase {
/** /**
* Creates the childeren of the parent object. * Creates the childeren of the parent object.
*
* @param parentElement The parent element to create the childeren from.' * @param parentElement The parent element to create the childeren from.'
* @throws ElementBindingHandlerException When binding could not happen. * @throws ElementBindingHandlerException When binding could not happen.
*/ */

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* ElementBindingException.<br> * ElementBindingException.<br>
* Is throw with there is a exception in binding the objects * Is throw with there is a exception in binding the objects
@ -36,6 +35,7 @@ public class ElementBindingHandlerException extends ElementException {
/** /**
* Creates binding exception. * Creates binding exception.
*
* @param message The error message. * @param message The error message.
*/ */
public ElementBindingHandlerException(String message) { public ElementBindingHandlerException(String message) {
@ -44,6 +44,7 @@ public class ElementBindingHandlerException extends ElementException {
/** /**
* Creates binding exception. * Creates binding exception.
*
* @param message The error message. * @param message The error message.
* @param exception The error exception. * @param exception The error exception.
*/ */

View file

@ -35,12 +35,14 @@ public interface ElementClass extends ElementClassBase {
/** /**
* Gets the ElementClass. * Gets the ElementClass.
*
* @return the elementClass * @return the elementClass
*/ */
Class<?> getElementClass(); Class<?> getElementClass();
/** /**
* Sets the ElementClass. * Sets the ElementClass.
*
* @param elementClass the elementClass to set. * @param elementClass the elementClass to set.
*/ */
void setElementClass(Class<?> elementClass); void setElementClass(Class<?> elementClass);
@ -97,18 +99,21 @@ public interface ElementClass extends ElementClassBase {
/** /**
* Add an skip phase for this element. * Add an skip phase for this element.
*
* @param phase The phase name. * @param phase The phase name.
*/ */
void addSkipPhase(String phase); void addSkipPhase(String phase);
/** /**
* Removes an skip phase for this element. * Removes an skip phase for this element.
*
* @param phase The phase name. * @param phase The phase name.
*/ */
void removeSkipPhase(String phase); void removeSkipPhase(String phase);
/** /**
* Get all the skip phases for this element. * Get all the skip phases for this element.
*
* @return The defined phases. * @return The defined phases.
*/ */
List<String> getSkipPhases(); List<String> getSkipPhases();

View file

@ -37,54 +37,63 @@ public interface ElementClassAttribute extends ElementMetaBase {
/** /**
* Gets the ObjectConverter. * Gets the ObjectConverter.
*
* @return The ObjectConverter. * @return The ObjectConverter.
*/ */
ObjectConverter getObjectConverter(); ObjectConverter getObjectConverter();
/** /**
* Add the ObjectConverter whichs converts. * Add the ObjectConverter whichs converts.
*
* @param objectConverter The objectConverter to set for this attribute. * @param objectConverter The objectConverter to set for this attribute.
*/ */
void setObjectConverter(ObjectConverter objectConverter); void setObjectConverter(ObjectConverter objectConverter);
/** /**
* Sets the defaultValue of this attribute. * Sets the defaultValue of this attribute.
*
* @param defaultValue The defaultValue to set. * @param defaultValue The defaultValue to set.
*/ */
void setDefaultValue(Object defaultValue); void setDefaultValue(Object defaultValue);
/** /**
* Gets the default value. * Gets the default value.
*
* @return Returns the default value if any. * @return Returns the default value if any.
*/ */
Object getDefaultValue(); Object getDefaultValue();
/** /**
* Add an attribute alias for this attribute. * Add an attribute alias for this attribute.
*
* @param alias The alias. * @param alias The alias.
*/ */
void addAttributeAlias(String alias); void addAttributeAlias(String alias);
/** /**
* Removes an attribute alias. * Removes an attribute alias.
*
* @param alias The alias. * @param alias The alias.
*/ */
void removeAttributeAlias(String alias); void removeAttributeAlias(String alias);
/** /**
* Get all the aliases for this attribute. * Get all the aliases for this attribute.
*
* @return The defined aliases. * @return The defined aliases.
*/ */
List<String> getAttributeAliases(); List<String> getAttributeAliases();
/** /**
* Gets the required state of this attribute. * Gets the required state of this attribute.
*
* @return If true then attribute is required. * @return If true then attribute is required.
*/ */
Boolean getRequired(); Boolean getRequired();
/** /**
* Sets the required state of this attribute. * Sets the required state of this attribute.
*
* @param required the required to set. * @param required the required to set.
*/ */
void setRequired(Boolean required); void setRequired(Boolean required);

View file

@ -35,31 +35,34 @@ import java.util.List;
public interface ElementClassBase extends ElementMetaBase { public interface ElementClassBase extends ElementMetaBase {
List<ElementConfigurator> getElementConfigurators(); List<ElementConfigurator> getElementConfigurators();
void addElementConfigurators(ElementConfigurator elementConfigurator); void addElementConfigurators(ElementConfigurator elementConfigurator);
Collection<ElementClassAttribute> getElementClassAttributes(); Collection<ElementClassAttribute> getElementClassAttributes();
ElementClassAttribute getElementClassAttributeByName(String attributeName); ElementClassAttribute getElementClassAttributeByName(String attributeName);
void addElementClassAttribute(ElementClassAttribute elementClassAttribute); void addElementClassAttribute(ElementClassAttribute elementClassAttribute);
/** /**
* Add an parent element tag. * Add an parent element tag. Used: for xsd/doc only.
* Used: for xsd/doc only. *
* @param namespaceUri The namespace uri of this tag relation. * @param namespaceUri The namespace uri of this tag relation.
* @param tag The parent element tag. * @param tag The parent element tag.
*/ */
void addElementParent(String namespaceUri, String tag); void addElementParent(String namespaceUri, String tag);
/** /**
* Remove and parent element * Remove and parent element Used: for xsd/doc only.
* Used: for xsd/doc only. *
* @param namespaceUri The namespace uri of this tag relation. * @param namespaceUri The namespace uri of this tag relation.
* @param tag The parent element tag. * @param tag The parent element tag.
*/ */
void removeElementParent(String namespaceUri, String tag); void removeElementParent(String namespaceUri, String tag);
/** /**
* Returns list of parent element tags. * Returns list of parent element tags. Used: for xsd/doc only.
* Used: for xsd/doc only. *
* @param namespaceUri The namespace uri of this tag relation. * @param namespaceUri The namespace uri of this tag relation.
* @return The list of tags. * @return The list of tags.
*/ */

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* Provides an Interface to configure Element(Object). * Provides an Interface to configure Element(Object).
* *
@ -34,15 +33,16 @@ public interface ElementConfigurator extends ElementMetaBase {
/** /**
* Gets called for configuring the given Element. * Gets called for configuring the given Element.
*
* @param element The element to config. * @param element The element to config.
* @throws ElementConfiguratorException Is thrown which error is done. * @throws ElementConfiguratorException Is thrown which error is done.
*/ */
void doConfigElement(Element element) throws ElementConfiguratorException; void doConfigElement(Element element) throws ElementConfiguratorException;
/** /**
* Return if this ElementConfigurator is an Action. * Return if this ElementConfigurator is an Action. which means is is executed in the runPhase in the end. So all magic is done, and we can access the fully
* which means is is executed in the runPhase in the end. * finnisched object and toss it around.
* So all magic is done, and we can access the fully finnisched object and toss it around. *
* @return Returns true if need to run in config phase. * @return Returns true if need to run in config phase.
*/ */
boolean isConfigAction(); boolean isConfigAction();

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* ElementConfiguratorException.<br> * ElementConfiguratorException.<br>
* *
@ -36,6 +35,7 @@ public class ElementConfiguratorException extends ElementException {
/** /**
* Creates an configurator exception. * Creates an configurator exception.
*
* @param config The ElementConfigurator. * @param config The ElementConfigurator.
* @param message The error message. * @param message The error message.
*/ */
@ -46,6 +46,7 @@ public class ElementConfiguratorException extends ElementException {
/** /**
* Creates an configurator exception. * Creates an configurator exception.
*
* @param config The ElementConfigurator. * @param config The ElementConfigurator.
* @param message The error message. * @param message The error message.
* @param exception The error exception. * @param exception The error exception.
@ -57,6 +58,7 @@ public class ElementConfiguratorException extends ElementException {
/** /**
* Creates an configurator exception. * Creates an configurator exception.
*
* @param config The ElementConfigurator. * @param config The ElementConfigurator.
* @param message The error message. * @param message The error message.
* @param exception The wrapped element error exception. * @param exception The wrapped element error exception.
@ -68,6 +70,7 @@ public class ElementConfiguratorException extends ElementException {
/** /**
* Gets the ElementConfigurator which has thrown this exception. * Gets the ElementConfigurator which has thrown this exception.
*
* @return The ElementConfigurator. * @return The ElementConfigurator.
*/ */
public ElementConfigurator getElementConfigurator() { public ElementConfigurator getElementConfigurator() {

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* Provides an Interface to configure Element(Object) global. * Provides an Interface to configure Element(Object) global.
* *

View file

@ -42,6 +42,7 @@ public class ElementException extends Exception {
/** /**
* Constructs an ElementException with a detail message. * Constructs an ElementException with a detail message.
*
* @param message The message of this Exception * @param message The message of this Exception
*/ */
public ElementException(String message) { public ElementException(String message) {
@ -50,6 +51,7 @@ public class ElementException extends Exception {
/** /**
* Creates an ElementException from a parent exception. * Creates an ElementException from a parent exception.
*
* @param e The error exception. * @param e The error exception.
*/ */
public ElementException(Exception e) { public ElementException(Exception e) {
@ -58,6 +60,7 @@ public class ElementException extends Exception {
/** /**
* Constructs an ElementException with a detail message. * Constructs an ElementException with a detail message.
*
* @param message The message of this Exception * @param message The message of this Exception
* @param e The error exception. * @param e The error exception.
*/ */

View file

@ -32,12 +32,14 @@ public interface ElementInterface extends ElementClassBase {
/** /**
* Gets this class of the interface to match this converters/etc/ to. * Gets this class of the interface to match this converters/etc/ to.
*
* @return the tag. * @return the tag.
*/ */
Class<?> getInterfaceClass(); Class<?> getInterfaceClass();
/** /**
* Sets the interface class. * Sets the interface class.
*
* @param interfaceClass the interfaceClass to set. * @param interfaceClass the interfaceClass to set.
*/ */
void setInterfaceClass(Class<?> interfaceClass); void setInterfaceClass(Class<?> interfaceClass);

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* ElementMetaBase provides a base interface describe meta information. * ElementMetaBase provides a base interface describe meta information.
* *
@ -34,24 +33,28 @@ public interface ElementMetaBase {
/** /**
* Sets the id of the ElementMetaBase. * Sets the id of the ElementMetaBase.
*
* @param id The id to set. * @param id The id to set.
*/ */
void setId(String id); void setId(String id);
/** /**
* Returns the id of the ElementMetaBase. * Returns the id of the ElementMetaBase.
*
* @return Returns the id. * @return Returns the id.
*/ */
String getId(); String getId();
/** /**
* Sets the description of the ElementMetaBase. * Sets the description of the ElementMetaBase.
*
* @param description The description to set. * @param description The description to set.
*/ */
void setDescription(String description); void setDescription(String description);
/** /**
* Returns the description of the ElementMetaBase. * Returns the description of the ElementMetaBase.
*
* @return Returns the description. * @return Returns the description.
*/ */
String getDescription(); String getDescription();

View file

@ -34,36 +34,42 @@ public interface ElementNamespace extends ElementMetaBase {
/** /**
* Sets the prefix mapping. * Sets the prefix mapping.
*
* @param prefixMapping The prefix mapping to set. * @param prefixMapping The prefix mapping to set.
*/ */
void setPrefixMapping(String prefixMapping); void setPrefixMapping(String prefixMapping);
/** /**
* Gets the set prefix mapping of this namespace. * Gets the set prefix mapping of this namespace.
*
* @return Returns the prefix mapping. * @return Returns the prefix mapping.
*/ */
String getPrefixMapping(); String getPrefixMapping();
/** /**
* Sets the elememen instance provider which creates the elements objects. * Sets the elememen instance provider which creates the elements objects.
*
* @param elementNamespaceInstanceProvider The ElementNamespaceInstanceProvider to set. * @param elementNamespaceInstanceProvider The ElementNamespaceInstanceProvider to set.
*/ */
void setElementNamespaceInstanceProvider(ElementNamespaceInstanceProvider elementNamespaceInstanceProvider); void setElementNamespaceInstanceProvider(ElementNamespaceInstanceProvider elementNamespaceInstanceProvider);
/** /**
* Returns the ElementProvider. * Returns the ElementProvider.
*
* @return Returns the ElementNamespaceInstanceProvider for this namespace. * @return Returns the ElementNamespaceInstanceProvider for this namespace.
*/ */
ElementNamespaceInstanceProvider getElementNamespaceInstanceProvider(); ElementNamespaceInstanceProvider getElementNamespaceInstanceProvider();
/** /**
* Adds an ElementClass. * Adds an ElementClass.
*
* @param elementClass The elementClass to add to this context. * @param elementClass The elementClass to add to this context.
*/ */
void addElementClass(ElementClass elementClass); void addElementClass(ElementClass elementClass);
/** /**
* Gets the ElementClass for an namespace and tag. * Gets the ElementClass for an namespace and tag.
*
* @param tag The tag to get the ElementClass for. * @param tag The tag to get the ElementClass for.
* @return Returns the ElementClass for a tag in an namespace. * @return Returns the ElementClass for a tag in an namespace.
*/ */
@ -71,6 +77,7 @@ public interface ElementNamespace extends ElementMetaBase {
/** /**
* Returns the loaded ElementClass'es in an namespace in this context. * Returns the loaded ElementClass'es in an namespace in this context.
*
* @return Returns all ElementClasses handled by this namespace. * @return Returns all ElementClasses handled by this namespace.
*/ */
List<ElementClass> getElementClasses(); List<ElementClass> getElementClasses();
@ -147,12 +154,14 @@ public interface ElementNamespace extends ElementMetaBase {
/** /**
* Adds an ElementNamespaceAttribute. * Adds an ElementNamespaceAttribute.
*
* @param elementNamespaceAttribute Adds an ElementNamespaceAttribute. * @param elementNamespaceAttribute Adds an ElementNamespaceAttribute.
*/ */
void addElementNamespaceAttribute(ElementNamespaceAttribute elementNamespaceAttribute); void addElementNamespaceAttribute(ElementNamespaceAttribute elementNamespaceAttribute);
/** /**
* Geta All ElementNamespaceAttributes. * Geta All ElementNamespaceAttributes.
*
* @return Returns an List of ElementNamespaceAttributes. * @return Returns an List of ElementNamespaceAttributes.
*/ */
List<ElementNamespaceAttribute> getElementNamespaceAttributes(); List<ElementNamespaceAttribute> getElementNamespaceAttributes();

View file

@ -34,31 +34,35 @@ public interface ElementNamespaceAttribute extends ElementConfigurator {
/** /**
* Gets the attribute name this attribute handler handles. * Gets the attribute name this attribute handler handles.
*
* @return Returns the attributes name of this attribute handler. * @return Returns the attributes name of this attribute handler.
*/ */
String getAttributeName(); String getAttributeName();
/** /**
* Sets the attribute name this attribute handler handles. * Sets the attribute name this attribute handler handles.
*
* @param attributeName The attribute to handle. * @param attributeName The attribute to handle.
*/ */
void setAttributeName(String attributeName); void setAttributeName(String attributeName);
/** /**
* Adds an NextAttribute. * Adds an NextAttribute. There next attributes will defines the order in which the ElementNamespaceAttribute are executed.
* There next attributes will defines the order in which the ElementNamespaceAttribute are executed. *
* @param attribute Add attribute which be will processed after this one. * @param attribute Add attribute which be will processed after this one.
*/ */
void addNextAttribute(String attribute); void addNextAttribute(String attribute);
/** /**
* Removes an next attribute. * Removes an next attribute.
*
* @param attribute Removes this next attribute. * @param attribute Removes this next attribute.
*/ */
void removeNextAttribute(String attribute); void removeNextAttribute(String attribute);
/** /**
* Get all next attributes. * Get all next attributes.
*
* @return Returns the list of all next attributes. * @return Returns the list of all next attributes.
*/ */
List<String> getNextAttributes(); List<String> getNextAttributes();

View file

@ -35,6 +35,7 @@ public interface ElementNamespaceInstanceProvider {
/** /**
* Starts the ElementProvider. * Starts the ElementProvider.
*
* @param language The X4OLanguage to start in. * @param language The X4OLanguage to start in.
* @param elementNamespace The elementNamespace to start for. * @param elementNamespace The elementNamespace to start for.
* @throws ElementNamespaceInstanceProviderException Thrown when error happened in language. * @throws ElementNamespaceInstanceProviderException Thrown when error happened in language.
@ -43,6 +44,7 @@ public interface ElementNamespaceInstanceProvider {
/** /**
* Provide an Element for an xml tag. * Provide an Element for an xml tag.
*
* @param languageSession The languageSession to create element for. * @param languageSession The languageSession to create element for.
* @param tag The xml tag to create instance for. * @param tag The xml tag to create instance for.
* @return An new Element instance. * @return An new Element instance.

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* ElementNamespaceInstanceProviderException holds the ElementNamespaceInstanceProvider which created this Exception.<br> * ElementNamespaceInstanceProviderException holds the ElementNamespaceInstanceProvider which created this Exception.<br>
* *
@ -36,6 +35,7 @@ public class ElementNamespaceInstanceProviderException extends ElementException
/** /**
* Creates provider instance exception. * Creates provider instance exception.
*
* @param elementNamespaceInstanceProvider The provider which creates this exception. * @param elementNamespaceInstanceProvider The provider which creates this exception.
* @param message The message of this exception. * @param message The message of this exception.
*/ */
@ -46,6 +46,7 @@ public class ElementNamespaceInstanceProviderException extends ElementException
/** /**
* Creates provider instance exception. * Creates provider instance exception.
*
* @param elementNamespaceInstanceProvider The provider which creates this exception. * @param elementNamespaceInstanceProvider The provider which creates this exception.
* @param message The message of this exception. * @param message The message of this exception.
* @param exception The root cause of this exception. * @param exception The root cause of this exception.
@ -57,6 +58,7 @@ public class ElementNamespaceInstanceProviderException extends ElementException
/** /**
* Gets the ElementNamespaceInstanceProvider which created this exception. * Gets the ElementNamespaceInstanceProvider which created this exception.
*
* @return The provider which created the exception. * @return The provider which created the exception.
*/ */
public ElementNamespaceInstanceProvider getElementNamespaceInstanceProvider() { public ElementNamespaceInstanceProvider getElementNamespaceInstanceProvider() {

View file

@ -34,6 +34,7 @@ public interface ElementObjectPropertyValue {
/** /**
* Sets an bean property of the object. * Sets an bean property of the object.
*
* @param object * @param object
* @param propertyName * @param propertyName
* @param value * @param value
@ -43,6 +44,7 @@ public interface ElementObjectPropertyValue {
/** /**
* Get the value of a properterie of a bean, * Get the value of a properterie of a bean,
*
* @param object The object to get the properties from * @param object The object to get the properties from
* @param propertyName The name of the property to get. * @param propertyName The name of the property to get.
* @return Returns the value of the property. * @return Returns the value of the property.
@ -52,6 +54,7 @@ public interface ElementObjectPropertyValue {
/** /**
* Sets all bean properties. * Sets all bean properties.
*
* @param object To object to set all the properties to. * @param object To object to set all the properties to.
* @param propertyMap A Map with the keys as properties names and the valua as value to set. * @param propertyMap A Map with the keys as properties names and the valua as value to set.
* @throws ElementObjectPropertyValueException * @throws ElementObjectPropertyValueException

View file

@ -22,7 +22,6 @@
*/ */
package org.x4o.xml.element; package org.x4o.xml.element;
/** /**
* ElementObjectPropertyValueException.<br> * ElementObjectPropertyValueException.<br>
* Is throw when the attribute value could not be found. * Is throw when the attribute value could not be found.
@ -36,6 +35,7 @@ public class ElementObjectPropertyValueException extends ElementException {
/** /**
* Creates ElementObjectPropertyValueException with message. * Creates ElementObjectPropertyValueException with message.
*
* @param message The error message. * @param message The error message.
*/ */
public ElementObjectPropertyValueException(String message) { public ElementObjectPropertyValueException(String message) {
@ -44,6 +44,7 @@ public class ElementObjectPropertyValueException extends ElementException {
/** /**
* Creates ElementObjectPropertyValueException with message and exception. * Creates ElementObjectPropertyValueException with message and exception.
*
* @param message The error message. * @param message The error message.
* @param exception The error exception. * @param exception The error exception.
*/ */

View file

@ -64,6 +64,7 @@ public abstract class AbstractX4OConnection extends AbstractX4OConnectionDebug {
/** /**
* Sets an X4O Language property. * Sets an X4O Language property.
*
* @param key The key of the property to set. * @param key The key of the property to set.
* @param value The vlue of the property to set. * @param value The vlue of the property to set.
*/ */

View file

@ -53,7 +53,8 @@ public abstract class AbstractX4OConnectionDebug implements X4OConnection {
protected final static String ABSTRACT_DEBUG_OUTPUT_HANDLER = "debug/output-handler"; protected final static String ABSTRACT_DEBUG_OUTPUT_HANDLER = "debug/output-handler";
protected final static String ABSTRACT_DEBUG_OUTPUT_STREAM = "debug/output-stream"; protected final static String ABSTRACT_DEBUG_OUTPUT_STREAM = "debug/output-stream";
protected void debugStart(X4OLanguageSession languageSession, String debugHandlerKey, String debugStreamKey) throws UnsupportedEncodingException, SAXException { protected void debugStart(X4OLanguageSession languageSession, String debugHandlerKey, String debugStreamKey)
throws UnsupportedEncodingException, SAXException {
Object debugOutputHandler = getProperty(debugHandlerKey); Object debugOutputHandler = getProperty(debugHandlerKey);
Object debugOutputStream = getProperty(debugStreamKey); Object debugOutputStream = getProperty(debugStreamKey);
// init debug infra // init debug infra

View file

@ -120,8 +120,7 @@ abstract public class AbstractX4OReader<T> extends AbstractX4OReaderSession<T> i
} }
/** /**
* Fetched the data direct from remote url to a InputStream to is can me readd * Fetched the data direct from remote url to a InputStream to is can me readd by SAX.
* by SAX.
* *
* @param url The url to read. * @param url The url to read.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.

View file

@ -59,6 +59,7 @@ public class DefaultX4OReader<T> extends AbstractX4OReader<T> {
private final SAX3PropertyConfig propertyConfig; private final SAX3PropertyConfig propertyConfig;
private final Map<String, Object> elBeans = new HashMap<>(); private final Map<String, Object> elBeans = new HashMap<>();
//@formatter:off
private final static String PROPERTY_CONTEXT_PREFIX = SAX3PropertyConfig.X4O_PROPERTIES_PREFIX+"reader/x4o/"; private final static String PROPERTY_CONTEXT_PREFIX = SAX3PropertyConfig.X4O_PROPERTIES_PREFIX+"reader/x4o/";
public final static SAX3PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static SAX3PropertyConfig DEFAULT_PROPERTY_CONFIG;
public final static String SAX_ERROR_HANDLER = PROPERTY_CONTEXT_PREFIX + "sax/error-handler"; public final static String SAX_ERROR_HANDLER = PROPERTY_CONTEXT_PREFIX + "sax/error-handler";
@ -96,6 +97,7 @@ public class DefaultX4OReader<T> extends AbstractX4OReader<T> {
new PropertyConfigItem(DEBUG_OUTPUT_STREAM,OutputStream.class) new PropertyConfigItem(DEBUG_OUTPUT_STREAM,OutputStream.class)
); );
} }
//@formatter:on
public DefaultX4OReader(X4OLanguage language) { public DefaultX4OReader(X4OLanguage language) {
super(language); super(language);
@ -111,13 +113,15 @@ public class DefaultX4OReader<T> extends AbstractX4OReader<T> {
} }
@Override @Override
public void readSession(X4OLanguageSession languageSession, InputStream input, String systemId, URL basePath) throws X4OConnectionException, SAXException, IOException { public void readSession(X4OLanguageSession languageSession, InputStream input, String systemId, URL basePath)
throws X4OConnectionException, SAXException, IOException {
setProperty(INPUT_STREAM, input); setProperty(INPUT_STREAM, input);
setProperty(INPUT_SYSTEM_ID, systemId); setProperty(INPUT_SYSTEM_ID, systemId);
setProperty(INPUT_BASE_PATH, basePath); setProperty(INPUT_BASE_PATH, basePath);
for (String name : elBeans.keySet()) { for (String name : elBeans.keySet()) {
Object bean = elBeans.get(name); Object bean = elBeans.get(name);
ValueExpression ve = languageSession.getExpressionLanguageFactory().createValueExpression(languageSession.getExpressionLanguageContext(),"${"+name+"}", bean.getClass()); ValueExpression ve = languageSession.getExpressionLanguageFactory().createValueExpression(languageSession.getExpressionLanguageContext(),
"${" + name + "}", bean.getClass());
ve.setValue(languageSession.getExpressionLanguageContext(), bean); ve.setValue(languageSession.getExpressionLanguageContext(), bean);
} }
readSession(languageSession); readSession(languageSession);

View file

@ -68,6 +68,7 @@ public class DefaultX4OWriter<T> extends AbstractX4OWriter<T> {
private boolean schemaUriPrint; private boolean schemaUriPrint;
private String schemaUriRoot; private String schemaUriRoot;
//@formatter:off
private final static AttributeEntryComparator ATTR_ENTRY_COMPARATOR = new AttributeEntryComparator(); private final static AttributeEntryComparator ATTR_ENTRY_COMPARATOR = new AttributeEntryComparator();
private final static String PROPERTY_CONTEXT_PREFIX = SAX3PropertyConfig.X4O_PROPERTIES_PREFIX+"writer/x4o/"; private final static String PROPERTY_CONTEXT_PREFIX = SAX3PropertyConfig.X4O_PROPERTIES_PREFIX+"writer/x4o/";
public final static SAX3PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static SAX3PropertyConfig DEFAULT_PROPERTY_CONFIG;
@ -88,6 +89,7 @@ public class DefaultX4OWriter<T> extends AbstractX4OWriter<T> {
new PropertyConfigItem(DEBUG_OUTPUT_STREAM,OutputStream.class) new PropertyConfigItem(DEBUG_OUTPUT_STREAM,OutputStream.class)
); );
} }
//@formatter:on
/** /**
* Default constructor. * Default constructor.

View file

@ -41,6 +41,7 @@ public interface X4OConnection {
/** /**
* Sets an X4O Language property. * Sets an X4O Language property.
*
* @param key The key of the property to set. * @param key The key of the property to set.
* @param value The value of the property to set. * @param value The value of the property to set.
*/ */

View file

@ -42,6 +42,7 @@ public class X4OConnectionException extends Exception {
/** /**
* Constructs an X4OConnectionException with a detail message. * Constructs an X4OConnectionException with a detail message.
*
* @param message The message of this Exception * @param message The message of this Exception
*/ */
public X4OConnectionException(String message) { public X4OConnectionException(String message) {
@ -50,6 +51,7 @@ public class X4OConnectionException extends Exception {
/** /**
* Creates an X4OConnectionException from a parent exception. * Creates an X4OConnectionException from a parent exception.
*
* @param e The error exception. * @param e The error exception.
*/ */
public X4OConnectionException(Exception e) { public X4OConnectionException(Exception e) {
@ -58,6 +60,7 @@ public class X4OConnectionException extends Exception {
/** /**
* Constructs an X4OConnectionException with a detail message. * Constructs an X4OConnectionException with a detail message.
*
* @param message The message of this Exception * @param message The message of this Exception
* @param e The error exception. * @param e The error exception.
*/ */

View file

@ -71,8 +71,7 @@ public class X4OContentHandler extends DefaultHandler2 {
private final SAX3PropertyConfig propertyConfig; private final SAX3PropertyConfig propertyConfig;
/** /**
* Creates an X4OTagHandler * Creates an X4OTagHandler which can receice sax xml events and converts them into the Element* interfaces events.
* which can receice sax xml events and converts them into the Element* interfaces events.
*/ */
public X4OContentHandler(X4OLanguageSession elementLanguage, SAX3PropertyConfig propertyConfig) { public X4OContentHandler(X4OLanguageSession elementLanguage, SAX3PropertyConfig propertyConfig) {
logger = Logger.getLogger(X4OContentHandler.class.getName()); logger = Logger.getLogger(X4OContentHandler.class.getName());
@ -206,9 +205,8 @@ public class X4OContentHandler extends DefaultHandler2 {
} }
/** /**
* Gets called to pass the text between XML-tags and converts it to a String. * Gets called to pass the text between XML-tags and converts it to a String. When this string is 0 length then nothing is done. If there are no element on
* When this string is 0 length then nothing is done. * the stact noting is done.
* If there are no element on the stact noting is done.
* *
* @see org.xml.sax.helpers.DefaultHandler#characters(char[],int,int) * @see org.xml.sax.helpers.DefaultHandler#characters(char[],int,int)
*/ */

View file

@ -190,7 +190,8 @@ public class X4OContentParser {
public Map<String, Object> getSAXParserPropertiesOptional(X4OLanguageSession elementContext) { public Map<String, Object> getSAXParserPropertiesOptional(X4OLanguageSession elementContext) {
Map<String, Object> saxParserProperties = new HashMap<String, Object>(1); Map<String, Object> saxParserProperties = new HashMap<String, Object>(1);
saxParserProperties.put("http://apache.org/xml/properties/input-buffer-size",getPropertyConfig().getProperty(DefaultX4OReader.DOC_BUFFER_SIZE)); // Increase buffer to 8KB // Increase buffer to 8KB
saxParserProperties.put("http://apache.org/xml/properties/input-buffer-size", getPropertyConfig().getProperty(DefaultX4OReader.DOC_BUFFER_SIZE));
return saxParserProperties; return saxParserProperties;
} }
@ -198,6 +199,7 @@ public class X4OContentParser {
// see example: http://xerces.apache.org/xerces2-j/features.html // see example: http://xerces.apache.org/xerces2-j/features.html
Map<String, Boolean> saxParserFeatures = new HashMap<String, Boolean>(20); Map<String, Boolean> saxParserFeatures = new HashMap<String, Boolean>(20);
//@formatter:off
// Tune Sax Parser // Tune Sax Parser
saxParserFeatures.put("http://xml.org/sax/features/namespaces", true); // Perform namespace processing saxParserFeatures.put("http://xml.org/sax/features/namespaces", true); // Perform namespace processing
@ -235,14 +237,14 @@ public class X4OContentParser {
} else { } else {
saxParserFeatures.put("http://apache.org/xml/features/validation/schema-full-checking", false); // Disable validation of the schema grammar itself for errors. saxParserFeatures.put("http://apache.org/xml/features/validation/schema-full-checking", false); // Disable validation of the schema grammar itself for errors.
} }
//@formatter:on
return saxParserFeatures; return saxParserFeatures;
} }
public Map<String, Boolean> getSAXParserFeaturesOptional(X4OLanguageSession elementContext) { public Map<String, Boolean> getSAXParserFeaturesOptional(X4OLanguageSession elementContext) {
Map<String, Boolean> saxParserFeatures = new HashMap<String, Boolean>(20); Map<String, Boolean> saxParserFeatures = new HashMap<String, Boolean>(20);
//@formatter:off
// Make Sax Impl more strict. // Make Sax Impl more strict.
saxParserFeatures.put("http://apache.org/xml/features/disallow-doctype-decl", true); // Throws error if document contains a DOCTYPE declaration. saxParserFeatures.put("http://apache.org/xml/features/disallow-doctype-decl", true); // Throws error if document contains a DOCTYPE declaration.
saxParserFeatures.put("http://apache.org/xml/features/validation/schema/normalized-value", true); // Expose normalized values for attributes and elements. saxParserFeatures.put("http://apache.org/xml/features/validation/schema/normalized-value", true); // Expose normalized values for attributes and elements.
@ -257,15 +259,17 @@ public class X4OContentParser {
//saxParserFeatures.put("http://apache.org/xml/features/validation/warn-on-undeclared-elemdef", true); // Report a warning if an element referenced in a content model is not declared. //saxParserFeatures.put("http://apache.org/xml/features/validation/warn-on-undeclared-elemdef", true); // Report a warning if an element referenced in a content model is not declared.
//saxParserFeatures.put("http://apache.org/xml/features/validation/balance-syntax-trees", false); // No optimize DTD content models. //saxParserFeatures.put("http://apache.org/xml/features/validation/balance-syntax-trees", false); // No optimize DTD content models.
//saxParserFeatures.put("http://apache.org/xml/features/validation/unparsed-entity-checking", false); // Do not check that each value of type ENTITY in DTD. //saxParserFeatures.put("http://apache.org/xml/features/validation/unparsed-entity-checking", false); // Do not check that each value of type ENTITY in DTD.
//@formatter:on
return saxParserFeatures; return saxParserFeatures;
} }
public List<String> getSAXParserFeaturesRequired(X4OLanguageSession elementContext) { public List<String> getSAXParserFeaturesRequired(X4OLanguageSession elementContext) {
List<String> result = new ArrayList<String>(5); List<String> result = new ArrayList<String>(5);
//@formatter:off
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-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. result.add("http://xml.org/sax/features/use-locator2"); // Locator objects passed by the parser are org.xml.sax.ext.Locator2 interface.
result.add("http://xml.org/sax/features/xml-1.1"); // The parser supports both XML 1.0 and XML 1.1. result.add("http://xml.org/sax/features/xml-1.1"); // The parser supports both XML 1.0 and XML 1.1.
//@formatter:on
return result; return result;
} }
} }

View file

@ -77,6 +77,7 @@ public class X4ODebugWriter {
} }
// TODO: rename most debug tags // TODO: rename most debug tags
//@formatter:off
enum Tag { enum Tag {
executePhase, executePhase,
executePhaseDone, executePhaseDone,
@ -135,6 +136,7 @@ public class X4ODebugWriter {
end end
} }
//@formatter:on
public X4OPhaseListener createDebugX4OPhaseListener() { public X4OPhaseListener createDebugX4OPhaseListener() {
return new DebugX4OPhaseListener(); return new DebugX4OPhaseListener();
@ -236,7 +238,6 @@ public class X4ODebugWriter {
contentWriter.printTagEnd(Tag.X4OConnectionProperties); contentWriter.printTagEnd(Tag.X4OConnectionProperties);
} }
public void debugConnectionEnd() throws IOException { public void debugConnectionEnd() throws IOException {
contentWriter.printTagEnd(Tag.X4OConnection); contentWriter.printTagEnd(Tag.X4OConnection);
} }
@ -456,6 +457,7 @@ public class X4ODebugWriter {
/** /**
* Todo move after xpath support. * Todo move after xpath support.
*
* @param element The element. * @param element The element.
* @param buff The buffer. * @param buff The buffer.
* @return Returns the buffer of the builf path. * @return Returns the buffer of the builf path.
@ -639,13 +641,16 @@ public class X4ODebugWriter {
/** /**
* Creates an debug phase * Creates an debug phase
*
* @return The X4OPhaseHandler for this phase. * @return The X4OPhaseHandler for this phase.
*/ */
public X4OPhaseListener createDebugPrintTreePhaseListener() { public X4OPhaseListener createDebugPrintTreePhaseListener() {
return new X4OPhaseListener() { return new X4OPhaseListener() {
List<String> startedPrefix = new ArrayList<String>(10); List<String> startedPrefix = new ArrayList<String>(10);
public void preRunPhase(X4OPhase phase, X4OLanguageSession languageSession) throws X4OPhaseException { public void preRunPhase(X4OPhase phase, X4OLanguageSession languageSession) throws X4OPhaseException {
} }
public void endRunPhase(X4OPhase phase, X4OLanguageSession languageSession) throws X4OPhaseException { public void endRunPhase(X4OPhase phase, X4OLanguageSession languageSession) throws X4OPhaseException {
if (languageSession.hasX4ODebugWriter() == false) { if (languageSession.hasX4ODebugWriter() == false) {
throw new X4OPhaseException(phase, "Use debugPhase only when X4OParser.debugWriter is filled."); throw new X4OPhaseException(phase, "Use debugPhase only when X4OParser.debugWriter is filled.");

View file

@ -42,11 +42,7 @@ import org.xml.sax.SAXException;
/** /**
* X4OEntityResolver resolves internel entities and proxy to external defined ones. * X4OEntityResolver resolves internel entities and proxy to external defined ones.
* *
* Resolve order; * Resolve order; 1) validation base path dir 2) external resolver 3) lookup for language in classpath. 4) throw exception
* 1) validation base path dir
* 2) external resolver
* 3) lookup for language in classpath.
* 4) throw exception
* *
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Aug 22, 2012 * @version 1.0 Aug 22, 2012
@ -61,6 +57,7 @@ public class X4OEntityResolver implements EntityResolver {
/** /**
* Creates an X4OEntityResolver for a language. * Creates an X4OEntityResolver for a language.
*
* @param elementContext The x4o language to resolve entities for. * @param elementContext The x4o language to resolve entities for.
*/ */
public X4OEntityResolver(X4OLanguageSession elementContext, SAX3PropertyConfig propertyConfig) { public X4OEntityResolver(X4OLanguageSession elementContext, SAX3PropertyConfig propertyConfig) {

View file

@ -42,6 +42,7 @@ public class X4OErrorHandler implements ErrorHandler {
/** /**
* Construct a new SAXErrorPrinter * Construct a new SAXErrorPrinter
*
* @param languageSession The language to get errors to. * @param languageSession The language to get errors to.
*/ */
public X4OErrorHandler(X4OLanguageSession languageSession, SAX3PropertyConfig propertyConfig) { public X4OErrorHandler(X4OLanguageSession languageSession, SAX3PropertyConfig propertyConfig) {

View file

@ -41,6 +41,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Adds an bean instance to the el context. * Adds an bean instance to the el context.
*
* @param name The el name for the bean. * @param name The el name for the bean.
* @param bean The bean to add to the el context. * @param bean The bean to add to the el context.
*/ */
@ -48,6 +49,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Method to parse the xml data. * Method to parse the xml data.
*
* @param input The inputStream to parse. * @param input The inputStream to parse.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
* @throws SAXException Is thrown after sax xml exception. * @throws SAXException Is thrown after sax xml exception.
@ -57,6 +59,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Reads the file fileName and parses it as an InputStream. * Reads the file fileName and parses it as an InputStream.
*
* @param fileName The file name to parse. * @param fileName The file name to parse.
* @throws FileNotFoundException Is thrown is file is not found. * @throws FileNotFoundException Is thrown is file is not found.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
@ -68,6 +71,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Reads the file and parses it as an InputStream. * Reads the file and parses it as an InputStream.
*
* @param file The file to parse. * @param file The file to parse.
* @throws FileNotFoundException Is thrown is file is not found. * @throws FileNotFoundException Is thrown is file is not found.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
@ -79,6 +83,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Parses an resource locaction. * Parses an resource locaction.
*
* @param resourceName The resource to parser. * @param resourceName The resource to parser.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
* @throws SAXException Is thrown after sax xml exception. * @throws SAXException Is thrown after sax xml exception.
@ -89,6 +94,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Converts a String to a InputStream to is can me parsed by SAX. * Converts a String to a InputStream to is can me parsed by SAX.
*
* @param xmlString The xml as String to parse. * @param xmlString The xml as String to parse.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
* @throws SAXException Is thrown after sax xml exception. * @throws SAXException Is thrown after sax xml exception.
@ -99,6 +105,7 @@ public interface X4OReader<T> extends X4OConnection {
/** /**
* Fetched the data direct from remote url to a InputStream to is can me parsed by SAX. * Fetched the data direct from remote url to a InputStream to is can me parsed by SAX.
*
* @param url The url to parse. * @param url The url to parse.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
* @throws SAXException Is thrown after sax xml exception. * @throws SAXException Is thrown after sax xml exception.

View file

@ -41,6 +41,7 @@ public interface X4OReaderSession<T> extends X4OReader<T> {
/** /**
* Method to parse the xml data. * Method to parse the xml data.
*
* @param session The language session. * @param session The language session.
* @param input The inputStream to parse. * @param input The inputStream to parse.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
@ -51,6 +52,7 @@ public interface X4OReaderSession<T> extends X4OReader<T> {
/** /**
* Reads the file fileName and parses it as an InputStream. * Reads the file fileName and parses it as an InputStream.
*
* @param session The language session. * @param session The language session.
* @param fileName The file name to parse. * @param fileName The file name to parse.
* @throws FileNotFoundException Is thrown is file is not found. * @throws FileNotFoundException Is thrown is file is not found.
@ -63,6 +65,7 @@ public interface X4OReaderSession<T> extends X4OReader<T> {
/** /**
* Reads the file and parses it as an InputStream. * Reads the file and parses it as an InputStream.
*
* @param session The language session. * @param session The language session.
* @param file The file to parse. * @param file The file to parse.
* @throws FileNotFoundException Is thrown is file is not found. * @throws FileNotFoundException Is thrown is file is not found.
@ -75,6 +78,7 @@ public interface X4OReaderSession<T> extends X4OReader<T> {
/** /**
* Parses an resource locaction. * Parses an resource locaction.
*
* @param session The language session. * @param session The language session.
* @param resourceName The resource to parser. * @param resourceName The resource to parser.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
@ -86,6 +90,7 @@ public interface X4OReaderSession<T> extends X4OReader<T> {
/** /**
* Converts a String to a InputStream to is can be parsed by SAX. * Converts a String to a InputStream to is can be parsed by SAX.
*
* @param session The language session. * @param session The language session.
* @param xmlString The xml as String to parse. * @param xmlString The xml as String to parse.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.
@ -97,6 +102,7 @@ public interface X4OReaderSession<T> extends X4OReader<T> {
/** /**
* Fetched the data direct from remote url to a InputStream to is can be parsed by SAX. * Fetched the data direct from remote url to a InputStream to is can be parsed by SAX.
*
* @param session The language session. * @param session The language session.
* @param url The url to parse. * @param url The url to parse.
* @throws X4OConnectionException Is thrown after x4o exception. * @throws X4OConnectionException Is thrown after x4o exception.