X4O: Replaced java EL dep of driver with local code
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 12s
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 12s
This commit is contained in:
parent
bc4b3a272c
commit
7ce5c2fc91
26 changed files with 86 additions and 608 deletions
|
|
@ -37,12 +37,15 @@ open module ᣕᕁᐤᣳ.ᕽᙾᐤ.ᒄᣗᑊᘁᓫᣗ {
|
|||
requires transitive ᣕᕁᐤᣳ.ᕽᙾᐤ.ᔿᣔᑊᔆᒄᐤᒼ;
|
||||
requires transitive ᣕᕁᐤᣳ.ᕽᙾᐤ.ᣘᒼᣳᔥ;
|
||||
requires transitive java.logging;
|
||||
requires transitive org.apache.tomcat.jasper.el;
|
||||
// TODO: remove EL, this breaks OSGI resolving
|
||||
//requires transitive org.apache.tomcat.jasper.el;
|
||||
|
||||
// TEMP for tests only
|
||||
requires java.desktop;
|
||||
// M2E is correct for now allowing two module-info per project, missing;
|
||||
//test-requires java.desktop;
|
||||
//test-requires transitive org.junit.jupiter.engine;
|
||||
//test-requires transitive org.junit.jupiter.api;
|
||||
|
||||
exports META-INF/x4o-drivers.xml;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@
|
|||
<groupId>love.distributedrebirth.nx01</groupId>
|
||||
<artifactId>nx01-x4o-maisdoc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jasper-el</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2014, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.x4o.xml.el;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import jakarta.el.ArrayELResolver;
|
||||
import jakarta.el.BeanELResolver;
|
||||
import jakarta.el.CompositeELResolver;
|
||||
import jakarta.el.ELContext;
|
||||
import jakarta.el.ELResolver;
|
||||
import jakarta.el.FunctionMapper;
|
||||
import jakarta.el.ListELResolver;
|
||||
import jakarta.el.MapELResolver;
|
||||
import jakarta.el.VariableMapper;
|
||||
|
||||
/**
|
||||
* X4OELFunctionMapper simple EL context.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 14, 2010
|
||||
*/
|
||||
public class X4OELContext extends ELContext {
|
||||
|
||||
private ELResolver elResolver = null;
|
||||
private FunctionMapper functionMapper = null;
|
||||
private VariableMapper variableMapper = null;
|
||||
|
||||
/**
|
||||
* Creates a X4OELContext.
|
||||
*/
|
||||
public X4OELContext() {
|
||||
|
||||
CompositeELResolver compositeELResolver = new CompositeELResolver();
|
||||
compositeELResolver.add(new X4OELResolver(new HashMap<Object, Object>(100)));
|
||||
compositeELResolver.add(new ArrayELResolver());
|
||||
compositeELResolver.add(new ListELResolver());
|
||||
compositeELResolver.add(new BeanELResolver());
|
||||
compositeELResolver.add(new MapELResolver());
|
||||
|
||||
elResolver = compositeELResolver;
|
||||
functionMapper = new X4OELFunctionMapper();
|
||||
variableMapper = new X4OELVariableMapper();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ELResolver.
|
||||
*
|
||||
* @return The ELResolver.
|
||||
* @see javax.el.ELContext#getELResolver()
|
||||
*/
|
||||
@Override
|
||||
public ELResolver getELResolver() {
|
||||
return elResolver;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the FunctionMapper.
|
||||
*
|
||||
* @return The FunctionMapper.
|
||||
* @see javax.el.ELContext#getFunctionMapper()
|
||||
*/
|
||||
@Override
|
||||
public FunctionMapper getFunctionMapper() {
|
||||
return functionMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the VariableMapper.
|
||||
*
|
||||
* @return The VariableMapper.
|
||||
* @see javax.el.ELContext#getVariableMapper()
|
||||
*/
|
||||
@Override
|
||||
public VariableMapper getVariableMapper() {
|
||||
return variableMapper;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2014, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.x4o.xml.el;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.el.FunctionMapper;
|
||||
|
||||
/**
|
||||
* X4OELFunctionMapper simple EL function mapper.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 14, 2010
|
||||
*/
|
||||
public class X4OELFunctionMapper extends FunctionMapper {
|
||||
|
||||
/**
|
||||
* Stores the el to method function mapping.
|
||||
*/
|
||||
private Map<String, Method> functionMap = null;
|
||||
|
||||
/**
|
||||
* Creates a X4OELFunctionMapper.
|
||||
*/
|
||||
public X4OELFunctionMapper() {
|
||||
functionMap = new HashMap<String, Method>(50);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves method el functions.
|
||||
*
|
||||
* @param prefix The function prefix.
|
||||
* @param localName The local name of function.
|
||||
* @return The resolved function or null is not found.
|
||||
*/
|
||||
@Override
|
||||
public Method resolveFunction(String prefix, String localName) {
|
||||
String key = prefix + ":" + localName;
|
||||
return functionMap.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an static method to the function mapper.
|
||||
*
|
||||
* @param prefix The function prefix.
|
||||
* @param localName The local name of function.
|
||||
* @param method The method to execute on.
|
||||
*/
|
||||
public void addFunction(String prefix, String localName, Method method) {
|
||||
if (prefix == null || localName == null || method == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
int modifiers = method.getModifiers();
|
||||
if (!Modifier.isPublic(modifiers)) {
|
||||
throw new IllegalArgumentException("method not public");
|
||||
}
|
||||
if (!Modifier.isStatic(modifiers)) {
|
||||
throw new IllegalArgumentException("method not static");
|
||||
}
|
||||
Class<?> retType = method.getReturnType();
|
||||
if (retType == Void.TYPE) {
|
||||
throw new IllegalArgumentException("method returns void");
|
||||
}
|
||||
|
||||
String key = prefix + ":" + localName;
|
||||
functionMap.put(key, method);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2014, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.x4o.xml.el;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.el.ELContext;
|
||||
import jakarta.el.ELResolver;
|
||||
import jakarta.el.MapELResolver;
|
||||
|
||||
/**
|
||||
* X4OELResolver simple EL resolver.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 14, 2010
|
||||
*/
|
||||
public class X4OELResolver extends ELResolver {
|
||||
|
||||
private ELResolver delegate = null;
|
||||
private Map<Object, Object> objectStore = null;
|
||||
|
||||
/**
|
||||
* Creates X4OELResolver which is backed by the objectStore.
|
||||
*
|
||||
* @param objectStore The objectStore.
|
||||
*/
|
||||
public X4OELResolver(Map<Object, Object> objectStore) {
|
||||
this.objectStore = objectStore;
|
||||
delegate = new MapELResolver();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if base object is null and else return objectStore.
|
||||
*
|
||||
* @param base The base object to check.
|
||||
* @return Returns the base object or objectStore.
|
||||
*/
|
||||
private Object checkBase(Object base) {
|
||||
if (base == null) {
|
||||
return objectStore;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(ELContext context, Object base, Object property) {
|
||||
base = checkBase(base);
|
||||
return delegate.getValue(context, base, property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getCommonPropertyType(ELContext context, Object base) {
|
||||
base = checkBase(base);
|
||||
return delegate.getCommonPropertyType(context, base);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
// public Iterator getFeatureDescriptors(ELContext context, Object base) {
|
||||
// base = checkBase(base);
|
||||
// return delegate.getFeatureDescriptors(context, base);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Class<?> getType(ELContext context, Object base, Object property) {
|
||||
base = checkBase(base);
|
||||
return delegate.getType(context, base, property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly(ELContext context, Object base, Object property) {
|
||||
base = checkBase(base);
|
||||
return delegate.isReadOnly(context, base, property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(ELContext context, Object base, Object property, Object value) {
|
||||
base = checkBase(base);
|
||||
delegate.setValue(context, base, property, value);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2014, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.x4o.xml.el;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
import jakarta.el.VariableMapper;
|
||||
|
||||
/**
|
||||
* X4OELVariableMapper simple EL variable mapper.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 14, 2010
|
||||
*/
|
||||
public class X4OELVariableMapper extends VariableMapper {
|
||||
|
||||
/** Map to hold all the expressions used. */
|
||||
private Map<String, ValueExpression> expressions = null;
|
||||
|
||||
/**
|
||||
* Creates the X4OELVariableMapper.
|
||||
*/
|
||||
public X4OELVariableMapper() {
|
||||
expressions = new HashMap<String, ValueExpression>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.el.VariableMapper#resolveVariable(java.lang.String)
|
||||
* @param var Resolve this var to an ValueExpression.
|
||||
* @return The resolved ValueExpression of the var.
|
||||
*/
|
||||
@Override
|
||||
public ValueExpression resolveVariable(String var) {
|
||||
return expressions.get(var);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.el.VariableMapper#setVariable(java.lang.String, javax.el.ValueExpression)
|
||||
* @param var Resolve this var to an ValueExpression.
|
||||
* @param expression The ValueExpression of the var.
|
||||
* @return The ValueExpression being set.
|
||||
*/
|
||||
@Override
|
||||
public ValueExpression setVariable(String var, ValueExpression expression) {
|
||||
return expressions.put(var, expression);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2014, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.x4o.xml.el;
|
||||
|
||||
import jakarta.el.ELContext;
|
||||
import jakarta.el.ExpressionFactory;
|
||||
|
||||
import org.x4o.xml.lang.X4OLanguageClassLoader;
|
||||
|
||||
/**
|
||||
* X4OExpressionFactory finds and loads the needed impl.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Apr 7, 2013
|
||||
*/
|
||||
public class X4OExpressionFactory {
|
||||
|
||||
static public final String EL_FACTORY_IMPL_APACHE = "org.apache.el.ExpressionFactoryImpl";
|
||||
static public final String EL_FACTORY_IMPL_ODYSSEUS = "de.odysseus.el.ExpressionFactoryImpl";
|
||||
|
||||
static public ExpressionFactory createExpressionFactory() {
|
||||
ExpressionFactory result = null;
|
||||
try {
|
||||
Class<?> expressionFactoryClass = X4OLanguageClassLoader.loadClass(EL_FACTORY_IMPL_APACHE);
|
||||
result = X4OLanguageClassLoader.newInstance(ExpressionFactory.class, expressionFactoryClass);
|
||||
} catch (ClassNotFoundException e) {
|
||||
try {
|
||||
Class<?> expressionFactoryClass = X4OLanguageClassLoader.loadClass(EL_FACTORY_IMPL_ODYSSEUS);
|
||||
result = X4OLanguageClassLoader.newInstance(ExpressionFactory.class, expressionFactoryClass);
|
||||
} 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.");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static public ELContext createELContext(Class<?> elContextClass) {
|
||||
try {
|
||||
return X4OLanguageClassLoader.newInstance(ELContext.class, elContextClass);
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException("Could not create instance of ELContext: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2014, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* The Expression Language classes.
|
||||
*
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
package org.x4o.xml.el;
|
||||
|
|
@ -25,8 +25,6 @@ package org.x4o.xml.eld;
|
|||
import java.io.IOException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
|
||||
import org.x4o.xml.X4ODriver;
|
||||
import org.x4o.xml.X4ODriverManager;
|
||||
import org.x4o.xml.io.DefaultX4OReader;
|
||||
|
|
@ -110,14 +108,16 @@ public class EldModuleLoader implements X4OLanguageModuleLoader {
|
|||
}
|
||||
|
||||
public static X4OLanguage getLanguage(X4OLanguageSession context) {
|
||||
ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),
|
||||
"${" + EL_PARENT_LANGUAGE + "}", X4OLanguage.class);
|
||||
return (X4OLanguage) ee.getValue(context.getExpressionLanguageContext());
|
||||
// ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),
|
||||
// "${" + EL_PARENT_LANGUAGE + "}", X4OLanguage.class);
|
||||
// return (X4OLanguage) ee.getValue(context.getExpressionLanguageContext());
|
||||
return (X4OLanguage) context.resolveContextBean("${" + EL_PARENT_LANGUAGE + "}");
|
||||
}
|
||||
|
||||
public static X4OLanguageModule getLanguageModule(X4OLanguageSession context) {
|
||||
ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),
|
||||
"${" + EL_PARENT_LANGUAGE_MODULE + "}", X4OLanguageModule.class);
|
||||
return (X4OLanguageModule) ee.getValue(context.getExpressionLanguageContext());
|
||||
// ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),
|
||||
// "${" + EL_PARENT_LANGUAGE_MODULE + "}", X4OLanguageModule.class);
|
||||
// return (X4OLanguageModule) ee.getValue(context.getExpressionLanguageContext());
|
||||
return (X4OLanguageModule) context.resolveContextBean("${" + EL_PARENT_LANGUAGE_MODULE + "}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ package org.x4o.xml.element;
|
|||
import java.util.Locale;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
|
||||
import org.x4o.xml.conv.ObjectConverterException;
|
||||
|
||||
/**
|
||||
|
|
@ -100,9 +98,10 @@ public class DefaultElementAttributeValueParser implements ElementAttributeValue
|
|||
* @see org.x4o.xml.element.ElementAttributeValueParser#getELParameterValue(java.lang.String, org.x4o.xml.element.Element)
|
||||
*/
|
||||
public Object getELParameterValue(String value, Element element) throws ElementAttributeValueParserException {
|
||||
ValueExpression e = element.getLanguageSession().getExpressionLanguageFactory()
|
||||
.createValueExpression(element.getLanguageSession().getExpressionLanguageContext(), (String) value, Object.class);
|
||||
return e.getValue(element.getLanguageSession().getExpressionLanguageContext());
|
||||
//ValueExpression e = element.getLanguageSession().getExpressionLanguageFactory()
|
||||
// .createValueExpression(element.getLanguageSession().getExpressionLanguageContext(), (String) value, Object.class);
|
||||
//return e.getValue(element.getLanguageSession().getExpressionLanguageContext());
|
||||
return element.getLanguageSession().resolveContextBean(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.x4o.sax3.io.ContentWriter;
|
||||
|
|
@ -115,16 +114,17 @@ public class DefaultX4OReader<T> extends AbstractX4OReader<T> {
|
|||
throws X4OConnectionException, SAXException, IOException {
|
||||
Objects.requireNonNull(languageSession, "Can't read into null language session");
|
||||
Objects.requireNonNull(input, "Can't read a null input stream");
|
||||
Objects.requireNonNull(systemId, "No system-id provided for the input streamn");
|
||||
Objects.requireNonNull(basePath, "No base-path provided for the input streamn"); // TODO; make optional, use default working folder
|
||||
Objects.requireNonNull(systemId, "No system-id provided for the input stream");
|
||||
Objects.requireNonNull(basePath, "No base-path provided for the input stream"); // TODO; make optional, use default working folder
|
||||
setProperty(INPUT_STREAM, input);
|
||||
setProperty(INPUT_SYSTEM_ID, systemId);
|
||||
setProperty(INPUT_BASE_PATH, basePath);
|
||||
for (String name : elBeans.keySet()) {
|
||||
Object bean = elBeans.get(name);
|
||||
ValueExpression ve = languageSession.getExpressionLanguageFactory().createValueExpression(languageSession.getExpressionLanguageContext(),
|
||||
"${" + name + "}", bean.getClass());
|
||||
ve.setValue(languageSession.getExpressionLanguageContext(), bean);
|
||||
languageSession.storeContextBean(name, bean);
|
||||
// ValueExpression ve = languageSession.getExpressionLanguageFactory().createValueExpression(languageSession.getExpressionLanguageContext(),
|
||||
// "${" + name + "}", bean.getClass());
|
||||
// ve.setValue(languageSession.getExpressionLanguageContext(), bean);
|
||||
}
|
||||
readSession(languageSession);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
|
|||
|
||||
private Class<?> defaultLanguageVersionFilter = null;
|
||||
private Class<?> defaultLanguageLoader = null;
|
||||
private Class<?> defaultExpressionLanguageContext = null;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
|
|
@ -295,18 +294,4 @@ public abstract class AbstractX4OLanguageConfiguration implements X4OLanguageCon
|
|||
public void setDefaultLanguageLoader(Class<?> defaultLanguageLoader) {
|
||||
this.defaultLanguageLoader = defaultLanguageLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultExpressionLanguageContext
|
||||
*/
|
||||
public Class<?> getDefaultExpressionLanguageContext() {
|
||||
return defaultExpressionLanguageContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultExpressionLanguageContext the defaultExpressionLanguageContext to set
|
||||
*/
|
||||
public void setDefaultExpressionLanguageContext(Class<?> defaultExpressionLanguageContext) {
|
||||
this.defaultExpressionLanguageContext = defaultExpressionLanguageContext;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,10 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import jakarta.el.ELContext;
|
||||
import jakarta.el.ExpressionFactory;
|
||||
|
||||
import org.x4o.xml.element.Element;
|
||||
import org.x4o.xml.element.ElementAttributeValueParser;
|
||||
import org.x4o.xml.element.ElementObjectPropertyValue;
|
||||
import org.x4o.xml.element.ElementObjectPropertyValueException;
|
||||
import org.x4o.xml.io.X4ODebugWriter;
|
||||
import org.x4o.xml.lang.phase.X4OPhase;
|
||||
import org.x4o.xml.lang.phase.X4OPhaseListener;
|
||||
|
|
@ -46,10 +44,9 @@ import org.x4o.xml.lang.phase.X4OPhaseListener;
|
|||
*/
|
||||
public abstract class AbstractX4OLanguageSession implements X4OLanguageSessionLocal {
|
||||
|
||||
private Logger logger = null;
|
||||
private X4OLanguage language = null;
|
||||
private ExpressionFactory expressionFactory = null;
|
||||
private ELContext eLContext = null;
|
||||
private final Logger logger;
|
||||
private final X4OLanguage language;
|
||||
private final Map<String, Object> beans = new HashMap<>();
|
||||
private ElementAttributeValueParser elementAttributeValueParser = null;
|
||||
private ElementObjectPropertyValue elementObjectPropertyValue = null;
|
||||
private List<Element> dirtyElements = null;
|
||||
|
|
@ -68,7 +65,7 @@ public abstract class AbstractX4OLanguageSession implements X4OLanguageSessionLo
|
|||
throw new NullPointerException("language may not be null");
|
||||
}
|
||||
logger = Logger.getLogger(AbstractX4OLanguageSession.class.getName());
|
||||
logger.finest("Creating new ParsingContext");
|
||||
logger.finest("Creating new " + this.getClass().getName());
|
||||
this.language = language;
|
||||
dirtyElements = new ArrayList<>(20);
|
||||
phaseSkip = new ArrayList<>(5);
|
||||
|
|
@ -78,39 +75,40 @@ public abstract class AbstractX4OLanguageSession implements X4OLanguageSessionLo
|
|||
public X4OLanguage getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.x4o.xml.lang.X4OLanguageSession#getExpressionLanguageContext()
|
||||
*/
|
||||
public ELContext getExpressionLanguageContext() {
|
||||
return eLContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.x4o.xml.lang.X4OLanguageSessionLocal#setExpressionLanguageContext(javax.el.ELContext)
|
||||
*/
|
||||
public void setExpressionLanguageContext(ELContext context) {
|
||||
if (eLContext != null) {
|
||||
throw new IllegalStateException("Can only set elContext once.");
|
||||
|
||||
public Object resolveContextBean(String named) {
|
||||
if (named.startsWith("${") == false) {
|
||||
return named; // equal to EL, rework invoke from X4OPhaseLanguageRead.java:359
|
||||
}
|
||||
eLContext = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.x4o.xml.lang.X4OLanguageSession#getExpressionLanguageFactory()
|
||||
*/
|
||||
public ExpressionFactory getExpressionLanguageFactory() {
|
||||
return expressionFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.x4o.xml.lang.X4OLanguageSessionLocal#setExpressionLanguageFactory(javax.el.ExpressionFactory)
|
||||
*/
|
||||
public void setExpressionLanguageFactory(ExpressionFactory expressionFactory) {
|
||||
if (this.expressionFactory != null) {
|
||||
throw new IllegalStateException("Can only set expressionFactory once.");
|
||||
named = named.substring(2, named.length() - 1);
|
||||
|
||||
Object result = null;
|
||||
if (named.contains(".")) {
|
||||
int dotIdx = named.indexOf('.');
|
||||
String beanName = named.substring(0, dotIdx);
|
||||
String beanPropPath = named.substring(dotIdx + 1, named.length());
|
||||
result = beans.get(beanName);
|
||||
if (result == null) {
|
||||
throw new NullPointerException("Failed to resolve: " + beanName);
|
||||
}
|
||||
try {
|
||||
result = getElementObjectPropertyValue().getProperty(result, beanPropPath);
|
||||
} catch (ElementObjectPropertyValueException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
} else {
|
||||
result = beans.get(named);
|
||||
}
|
||||
this.expressionFactory = expressionFactory;
|
||||
if (result == null) {
|
||||
//throw new NullPointerException("Failed to resolve: " + named);
|
||||
//TODO: fixme old java EL returns null, which fails unit tests on "date0" missing bean
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void storeContextBean(String name, Object bean) {
|
||||
logger.finer("storeContextBean name = " + name);
|
||||
beans.put(name, bean);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.x4o.xml.el.X4OExpressionFactory;
|
||||
import org.x4o.xml.element.Element;
|
||||
import org.x4o.xml.element.ElementAttributeValueParser;
|
||||
import org.x4o.xml.element.ElementBindingHandler;
|
||||
|
|
@ -147,13 +146,13 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
|
|||
|
||||
protected X4OLanguageSession buildElementLanguage(X4OLanguageSessionLocal languageSession) {
|
||||
try {
|
||||
if (languageSession.getExpressionLanguageFactory() == null) {
|
||||
languageSession.setExpressionLanguageFactory(X4OExpressionFactory.createExpressionFactory());
|
||||
}
|
||||
if (languageSession.getExpressionLanguageContext() == null) {
|
||||
languageSession.setExpressionLanguageContext(
|
||||
X4OExpressionFactory.createELContext(languageSession.getLanguage().getLanguageConfiguration().getDefaultExpressionLanguageContext()));
|
||||
}
|
||||
// if (languageSession.getExpressionLanguageFactory() == null) {
|
||||
// languageSession.setExpressionLanguageFactory(X4OExpressionFactory.createExpressionFactory());
|
||||
// }
|
||||
// if (languageSession.getExpressionLanguageContext() == null) {
|
||||
// languageSession.setExpressionLanguageContext(
|
||||
// X4OExpressionFactory.createELContext(languageSession.getLanguage().getLanguageConfiguration().getDefaultExpressionLanguageContext()));
|
||||
// }
|
||||
if (languageSession.getElementAttributeValueParser() == null) {
|
||||
languageSession.setElementAttributeValueParser(X4OLanguageClassLoader.newInstance(ElementAttributeValueParser.class,
|
||||
getLanguageConfiguration().getDefaultElementAttributeValueParser()));
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import java.lang.reflect.InvocationHandler;
|
|||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
import org.x4o.xml.el.X4OELContext;
|
||||
import org.x4o.xml.element.DefaultElement;
|
||||
import org.x4o.xml.element.DefaultElementAttributeValueParser;
|
||||
import org.x4o.xml.element.DefaultElementBodyCharacters;
|
||||
|
|
@ -73,7 +72,6 @@ public class DefaultX4OLanguageConfiguration extends AbstractX4OLanguageConfigur
|
|||
if (getDefaultElementNamespaceAttributeComparator()==null){ setDefaultElementNamespaceAttributeComparator( DefaultElementNamespaceAttributeComparator.class); }
|
||||
if (getDefaultLanguageVersionFilter()==null) { setDefaultLanguageVersionFilter( DefaultX4OLanguageVersionFilter.class); }
|
||||
if (getDefaultLanguageLoader()==null) { setDefaultLanguageLoader( DefaultX4OLanguageLoader.class); }
|
||||
if (getDefaultExpressionLanguageContext()==null) { setDefaultExpressionLanguageContext( X4OELContext.class); }
|
||||
}
|
||||
//@formatter:on
|
||||
|
||||
|
|
|
|||
|
|
@ -83,9 +83,4 @@ public interface X4OLanguageConfiguration {
|
|||
* @return Returns the X4OLanguageLoader which loads languages into the element context.
|
||||
*/
|
||||
Class<?> getDefaultLanguageLoader();
|
||||
|
||||
/**
|
||||
* @return Returns the Expression Language Context which holds the el objects.
|
||||
*/
|
||||
Class<?> getDefaultExpressionLanguageContext();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,4 @@ public interface X4OLanguageConfigurationLocal extends X4OLanguageConfiguration
|
|||
void setDefaultLanguageVersionFilter(Class<?> value);
|
||||
|
||||
void setDefaultLanguageLoader(Class<?> value);
|
||||
|
||||
void setDefaultExpressionLanguageContext(Class<?> value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ package org.x4o.xml.lang;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.el.ELContext;
|
||||
import jakarta.el.ExpressionFactory;
|
||||
|
||||
import org.x4o.xml.element.Element;
|
||||
import org.x4o.xml.element.ElementAttributeValueParser;
|
||||
import org.x4o.xml.element.ElementObjectPropertyValue;
|
||||
|
|
@ -46,20 +43,12 @@ public interface X4OLanguageSession extends AutoCloseable {
|
|||
* @return Returns the language from which this session in created.
|
||||
*/
|
||||
X4OLanguage getLanguage();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the EL Context.
|
||||
*
|
||||
* @return Returns the ELContext.
|
||||
*/
|
||||
ELContext getExpressionLanguageContext();
|
||||
|
||||
/**
|
||||
* Gets the ExpressionFactory.
|
||||
*
|
||||
* @return Returns the ExpressionFactory.
|
||||
*/
|
||||
ExpressionFactory getExpressionLanguageFactory();
|
||||
Object resolveContextBean(String named);
|
||||
|
||||
// move to local?
|
||||
void storeContextBean(String name, Object bean);
|
||||
|
||||
/**
|
||||
* @return Returns the ElementAttributeValueParser.
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ package org.x4o.xml.lang;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.el.ELContext;
|
||||
import jakarta.el.ExpressionFactory;
|
||||
|
||||
import org.x4o.xml.element.ElementAttributeValueParser;
|
||||
import org.x4o.xml.element.ElementObjectPropertyValue;
|
||||
import org.x4o.xml.io.X4ODebugWriter;
|
||||
|
|
@ -49,20 +46,6 @@ public interface X4OLanguageSessionLocal extends X4OLanguageSession {
|
|||
*/
|
||||
List<X4OPhaseListener> storePhaseListeners(String phaseId);
|
||||
|
||||
/**
|
||||
* Sets the EL Context.
|
||||
*
|
||||
* @param context The ELContext to set.
|
||||
*/
|
||||
void setExpressionLanguageContext(ELContext context);
|
||||
|
||||
/**
|
||||
* Sets the ExpressionFactory.
|
||||
*
|
||||
* @param expressionFactory The ExpressionFactory to set.
|
||||
*/
|
||||
void setExpressionLanguageFactory(ExpressionFactory expressionFactory);
|
||||
|
||||
/**
|
||||
* @param elementAttributeValueParser The elementAttributeValueParser to set.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ package org.x4o.xml.lang.meta;
|
|||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
|
||||
import org.x4o.xml.element.AbstractElementNamespaceAttribute;
|
||||
import org.x4o.xml.element.Element;
|
||||
import org.x4o.xml.element.ElementConfiguratorException;
|
||||
|
|
@ -56,10 +54,11 @@ public class ELIDAttributeHandler extends AbstractElementNamespaceAttribute {
|
|||
if (element.getElementObject() == null) {
|
||||
throw new NullPointerException("Can't bind null object to el context");
|
||||
}
|
||||
ValueExpression ee = element.getLanguageSession().getExpressionLanguageFactory().createValueExpression(
|
||||
element.getLanguageSession().getExpressionLanguageContext(), "${" + attributeValue + "}", element.getElementObject().getClass());
|
||||
//ValueExpression ee = element.getLanguageSession().getExpressionLanguageFactory().createValueExpression(
|
||||
// element.getLanguageSession().getExpressionLanguageContext(), "${" + attributeValue + "}", element.getElementObject().getClass());
|
||||
Logger.getLogger(ELIDAttributeHandler.class.getName())
|
||||
.finer("Set Variable in ELContext: " + "${" + attributeValue + "}" + " object SET: " + element.getElementObject());
|
||||
ee.setValue(element.getLanguageSession().getExpressionLanguageContext(), element.getElementObject());
|
||||
//ee.setValue(element.getLanguageSession().getExpressionLanguageContext(), element.getElementObject());
|
||||
element.getLanguageSession().storeContextBean(attributeValue, element.getElementObject());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ package org.x4o.xml.lang.meta;
|
|||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
|
||||
import org.x4o.xml.element.AbstractElement;
|
||||
import org.x4o.xml.element.ElementException;
|
||||
|
||||
|
|
@ -44,9 +42,10 @@ public class ELReferenceElement extends AbstractElement {
|
|||
if ("".equals(attributeValue) | attributeValue == null) {
|
||||
throw new ElementException("Set the el.ref attribute");
|
||||
}
|
||||
ValueExpression ee = getLanguageSession().getExpressionLanguageFactory().createValueExpression(getLanguageSession().getExpressionLanguageContext(),
|
||||
"${" + attributeValue + "}", Object.class);
|
||||
//ValueExpression ee = getLanguageSession().getExpressionLanguageFactory().createValueExpression(getLanguageSession().getExpressionLanguageContext(),
|
||||
// "${" + attributeValue + "}", Object.class);
|
||||
Logger.getLogger(ELReferenceElement.class.getName()).finer("Get Variable in ELContext: ${" + attributeValue + "}");
|
||||
setElementObject(ee.getValue(getLanguageSession().getExpressionLanguageContext()));
|
||||
//setElementObject(ee.getValue(getLanguageSession().getExpressionLanguageContext()));
|
||||
setElementObject(getLanguageSession().resolveContextBean("${" + attributeValue + "}"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ public class EldXsdLanguageTaskTest {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Test
|
||||
private File testSchema(String language, String outputPostfix, Map<String, Object> props) throws Exception {
|
||||
X4ODriver<?> driver = X4ODriverManager.getX4ODriver(language);
|
||||
X4OLanguageTask task = driver.getLanguageTask(EldXsdLanguageTask.TASK_ID);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import java.net.URL;
|
|||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.x4o.xml.X4ODriver;
|
||||
import org.x4o.xml.lang.X4OLanguageSession;
|
||||
import org.x4o.xml.test.TestDriver;
|
||||
import org.x4o.xml.test.models.TestBean;
|
||||
import org.x4o.xml.test.models.TestObjectRoot;
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ package org.x4o.xml.test.swixml;
|
|||
|
||||
import java.awt.Component;
|
||||
|
||||
import jakarta.el.ValueExpression;
|
||||
|
||||
import org.x4o.xml.X4ODriver;
|
||||
import org.x4o.xml.X4ODriverManager;
|
||||
import org.x4o.xml.lang.X4OLanguageSession;
|
||||
|
|
@ -52,9 +50,10 @@ public class SwiXmlDriver extends X4ODriver<Component> {
|
|||
* @return Returns the SwingEngine for this elementLanguage.
|
||||
*/
|
||||
static public SwingEngine getSwingEngine(X4OLanguageSession elementLanguage) {
|
||||
ValueExpression ee = elementLanguage.getExpressionLanguageFactory().createValueExpression(elementLanguage.getExpressionLanguageContext(),
|
||||
"${" + SwiXmlDriver.LANGUAGE_EL_SWING_ENGINE + "}", Object.class);
|
||||
SwingEngine se = (SwingEngine) ee.getValue(elementLanguage.getExpressionLanguageContext());
|
||||
//ValueExpression ee = elementLanguage.getExpressionLanguageFactory().createValueExpression(elementLanguage.getExpressionLanguageContext(),
|
||||
// "${" + SwiXmlDriver.LANGUAGE_EL_SWING_ENGINE + "}", Object.class);
|
||||
//SwingEngine se = (SwingEngine) ee.getValue(elementLanguage.getExpressionLanguageContext());
|
||||
SwingEngine se = (SwingEngine) elementLanguage.resolveContextBean("${" + SwiXmlDriver.LANGUAGE_EL_SWING_ENGINE + "}");
|
||||
return se;
|
||||
}
|
||||
|
||||
|
|
|
|||
5
pom.xml
5
pom.xml
|
|
@ -189,11 +189,6 @@
|
|||
<artifactId>commonmark</artifactId>
|
||||
<version>0.22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jasper-el</artifactId>
|
||||
<version>11.0.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ X4O is not an XML parser but a recursive self configuring XML dialect language l
|
|||
|
||||
X4O is very old code from pre 1.5 non-generics nice object java.
|
||||
|
||||
## 2025 TODO
|
||||
## 2025++ TODO
|
||||
|
||||
- Add 18 bit SAX4 XML read and write support
|
||||
- RM 8 bit String DEP, replace javax.el by simple obj map
|
||||
- (DONE) RM 8 bit String DEP, replace javax.el by simple obj map
|
||||
- Upgrade X4O element language to support 18 bit XML
|
||||
- Remove some features to ease "write" and SAX4 support
|
||||
- Move all XML uri's to oasis style thus replacing all internal http namespace locators
|
||||
|
|
@ -16,10 +16,10 @@ X4O is very old code from pre 1.5 non-generics nice object java.
|
|||
- Cleanup old todo/ideas from below
|
||||
- Add global task runners besides language task runners
|
||||
- Fix manual init of X4OLanguageLocal as it was designed that X4OLanguage + parsed ELD tree could be cached in driver manager
|
||||
- Rewrite model (.xml.element + .xml.eld.lang) to new enter-`RICE` bean replacement, split to data records and lamda records holders.
|
||||
|
||||
## OLD todo
|
||||
|
||||
- Fix debug output
|
||||
- RM function methods from Element interface
|
||||
- finish eld doc-output content
|
||||
- Make generic/safe? config bean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue