finisched x4o maven plugin and fixed javadoc errors.

This commit is contained in:
Willem Cazander 2013-04-14 21:59:26 +02:00
parent 6f45317753
commit 897fe80357
45 changed files with 656 additions and 239 deletions

View file

@ -32,11 +32,12 @@ mvn clean install;
-- Update schemas in src --
-- note; rm after auto schema creation
cd project-root/;
mvn clean install;
mvn -Pupdate-schema-cel package;
mvn -Pupdate-schema-eld package;
mvn -Pant-update-schema-cel package;
mvn -Pant-update-schema-eld package;
- Add the license as manual step in xsd files. (todo in ant task)
note: the do 'install' is because of circle plugins.
@ -54,7 +55,7 @@ src/main/build/gnu-up.sh <scm_username> <version>
-- Make site --
cd project-root/;
MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m" mvn -Psite-elddoc clean package site site:stage
MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m" mvn -Pbuild-site-x4o-support clean package site site:stage
-- Check for code style --
@ -81,4 +82,5 @@ mvn versions:display-dependency-updates;
cd project-root/;
mvn clean install;
mvn org.x4o.plugin:x4o-plugin-maven:help
mvn org.x4o.plugin:x4o-plugin-maven:write-language-doc -Dlanguages=cel -DoutputDirectory=/tmp/dd -Dverbose=true
mvn org.x4o.plugin:x4o-plugin-maven:write-language-doc -DoutputDirectory=/tmp/doc1
mvn org.x4o.plugin:x4o-plugin-maven:write-language-doc -DoutputDirectory=/tmp/doc2 -Dlanguages={eld=ALL,swixml=1.0-2.0} -Dverbose=true

View file

@ -51,13 +51,19 @@
<item name="Sample swixml" href="examples/sample-swixml.html"/>
<item name="Sample jr4o" href="examples/sample-jr4o.html"/>
</menu>
<menu name="EldDoc">
<item name="cel" href="elddocs/cel-1.0/index.html"/>
<item name="eld" href="elddocs/eld-1.0/index.html"/>
<item name="junit-test" href="elddocs/test-1.0/index.html"/>
<item name="junit-swixml2" href="elddocs/swixml-2.0/index.html"/>
<item name="junit-swixml3" href="elddocs/swixml-3.0/index.html"/>
<menu name="Support Doc">
<item name="cel" href="x4o-support/doc-cel-1.0/index.html"/>
<item name="eld" href="x4o-support/doc-eld-1.0/index.html"/>
<item name="junit-test" href="x4o-support/doc-test-1.0/index.html"/>
<item name="junit-swixml2" href="x4o-support/doc-swixml-2.0/index.html"/>
<item name="junit-swixml3" href="x4o-support/doc-swixml-3.0/index.html"/>
</menu>
<menu name="Support Schema">
<item name="cel" href="x4o-support/xsd-cel-1.0/"/>
<item name="eld" href="x4o-support/xsd-eld-1.0/"/>
<item name="junit-test" href="x4o-support/xsd-test-1.0/"/>
<item name="junit-swixml2" href="x4o-support/xsd-swixml-2.0/"/>
<item name="junit-swixml3" href="x4o-support/xsd-swixml-3.0/"/>
</menu>
<menu ref="parent"/>
<menu ref="modules"/>

View file

@ -146,16 +146,31 @@ public final class X4ODriverManager {
}
static public void registerX4ODriver(X4ODriver<?> driver) {
if (driver==null) {
throw new NullPointerException("Can't register null driver.");
}
if (driver.getLanguageName()==null) {
throw new NullPointerException("Error in driver impl languageName is null in: "+driver.getClass());
}
if (driver.getLanguageName().length()==0) {
throw new IllegalArgumentException("Error in driver impl languageName is empty in: "+driver.getClass());
}
if (driver.getLanguageVersions()==null) {
throw new NullPointerException("Error in driver impl languageVersions is null in: "+driver.getClass());
}
if (driver.getLanguageVersions().length==0) {
throw new IllegalArgumentException("Error in driver impl languageVersions is empty in: "+driver.getClass());
}
instance.drivers.put(driver.getLanguageName(), driver);
}
static public void deregisterX4ODriver(X4ODriver<?> driver) {
if (driver==null) {
throw new NullPointerException("Can't deregister null driver.");
}
if (driver.getLanguageName()==null) {
throw new NullPointerException("Error in driver impl languageName is null in: "+driver.getClass());
}
instance.drivers.remove(driver.getLanguageName());
}
@ -166,6 +181,9 @@ public final class X4ODriverManager {
if (language.isEmpty()) {
throw new IllegalArgumentException("Can't provider driver for empty language.");
}
if (instance.drivers.containsKey(language)) {
return instance.drivers.get(language);
}
try {
instance.lazyInit();
} catch (IOException e) {

View file

@ -136,7 +136,7 @@ public class StringSplitConverter extends AbstractStringObjectConverter {
* Converts object into string.
*
* @see org.x4o.xml.conv.AbstractStringObjectConverter#convertStringBack(java.lang.Object, java.util.Locale)
* @param obj The object to convert to string.
* @param object The object to convert to string.
* @param locale The locale to convert the object from.
* @return The string converted from the object.
* @throws ObjectConverterException When conversion fails.

View file

@ -61,8 +61,6 @@ public class EldModuleLoader implements X4OLanguageModuleLoader {
/** The EL key to access the parent language element langauge. */
public static final String EL_PARENT_LANGUAGE = "parentLanguage";
/**
* Creates an ELD/CEL module loader.
* @param eldResource The resource to load.
@ -79,10 +77,10 @@ public class EldModuleLoader implements X4OLanguageModuleLoader {
/**
* Loads the ELD language into the module.
* @param elementLanguage The langauge to load for.
* @param language The langauge to load for.
* @param elementLanguageModule The module to load it in.
* @throws X4OLanguageModuleLoaderException When eld language could not be loaded.
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageContext, org.x4o.xml.lang.X4OLanguageModule)
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageModule)
*/
public void loadLanguageModule(X4OLanguageLocal language,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException {
logger.fine("Loading name eld file from resource: "+eldResource);

View file

@ -82,9 +82,9 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
/**
* Loads the CEL language into the module.
* @param elementLanguage The langauge to load for.
* @param elementLanguageModule The module to load it in.
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.lang.X4OLanguageModule)
* @param language The langauge to load for.
* @param languageModule The module to load it in.
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageModule)
*/
public void loadLanguageModule(X4OLanguageLocal language,X4OLanguageModule languageModule) throws X4OLanguageModuleLoaderException {
@ -113,8 +113,8 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
/**
* Adds only Element class beans which need extra meta info for schema.
*
* @param elementClassList The list to fill.
* @param namespace The namespace to config.
* @param language The language to config for.
* @throws X4OLanguageModuleLoaderException
*/
private void configElementClasses(X4OLanguage language,ElementNamespaceContext namespace) throws X4OLanguageModuleLoaderException {
@ -243,8 +243,11 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
}
/**
* Creates new ElementClassAttribute instance.
* @param elementLanguage The ElementLanguage to create from.
* Creates new configed ElementClassAttribute instance.
* @param language The X4OLanguage to create from.
* @param name The name of the attribute.
* @param required Is the attribute required.
* @param converter The converter for the attribute.
* @return The new ElementClassAttribute instance.
* @throws X4OLanguageModuleLoaderException When class could not be created.
*/
@ -269,9 +272,10 @@ public class EldModuleLoaderCore implements X4OLanguageModuleLoader {
/**
* Adds binding handler to module.
* @param id The id to set on the handler.
* @param languageModule The language module.
* @param handler The handler to add the the module.
* @param languageModule The module to add the handler to.
* @param id The handler id.
* @param description The handler descripion.
*/
private void addBindingHandler(X4OLanguageModule languageModule,ElementBindingHandler handler,String id,String description) {
handler.setId(id);

View file

@ -56,12 +56,18 @@ public class ElementClassAttributeBindingHandler extends AbstractElementBindingH
return CLASSES_CHILD;
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,ElementClassAttribute parentObject,Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof ObjectConverter) {
parentObject.setObjectConverter((ObjectConverter)childObject);
}
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
public void createChilderen(Element parentElement,ElementClassAttribute parentObject) throws ElementBindingHandlerException {
createChild(parentElement, parentObject.getObjectConverter());
}

View file

@ -59,7 +59,7 @@ public class ElementClassBindingHandler extends AbstractElementBindingHandler<El
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element,java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,ElementClass parent, Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof ElementClassAttribute) {
@ -70,6 +70,9 @@ public class ElementClassBindingHandler extends AbstractElementBindingHandler<El
}
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
public void createChilderen(Element parentElement,ElementClass parent) throws ElementBindingHandlerException {
for (ElementClassAttribute child:parent.getElementClassAttributes()) {
createChild(parentElement, child);

View file

@ -60,7 +60,7 @@ public class ElementInterfaceBindingHandler extends AbstractElementBindingHandle
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,ElementInterface parent, Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof ElementBindingHandler) {
@ -74,6 +74,9 @@ public class ElementInterfaceBindingHandler extends AbstractElementBindingHandle
}
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
public void createChilderen(Element parentElement,ElementInterface parent) throws ElementBindingHandlerException {
for (ElementBindingHandler child:parent.getElementBindingHandlers()) {
createChild(parentElement, child);

View file

@ -75,7 +75,7 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler<
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,X4OLanguageModule languageModule, Object childObject) throws ElementBindingHandlerException {
@ -131,6 +131,9 @@ public class ElementModuleBindingHandler extends AbstractElementBindingHandler<
}
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
public void createChilderen(Element parentElement,X4OLanguageModule parent) throws ElementBindingHandlerException {
for (ElementInterface child:parent.getElementInterfaces()) {
createChild(parentElement, child);

View file

@ -56,7 +56,7 @@ public class ElementNamespaceContextBindingHandler extends AbstractElementBindin
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,ElementNamespaceContext parent, Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof ElementClass) {
@ -64,6 +64,9 @@ public class ElementNamespaceContextBindingHandler extends AbstractElementBindin
}
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
public void createChilderen(Element parentElement,ElementNamespaceContext parent) throws ElementBindingHandlerException {
for (ElementClass child:parent.getElementClasses()) {
createChild(parentElement, child);

View file

@ -60,7 +60,7 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element,java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement, Object parentObject, Object childObject) throws ElementBindingHandlerException {
@ -91,6 +91,9 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
throw new ElementBindingHandlerException("Could not find method: "+addMethod+" on: "+childClass+" id:"+getId());
}
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#createChilderen(org.x4o.xml.element.Element, java.lang.Object)
*/
@SuppressWarnings("rawtypes")
public void createChilderen(Element parentElement,Object parentObject) throws ElementBindingHandlerException {
if (parentClass==null | childClass==null | getMethod==null) {

View file

@ -57,7 +57,7 @@ public class StringSplitConverterBindingHandler extends AbstractElementBindingHa
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,StringSplitConverter parent, Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof StringSplitConverterStep) {

View file

@ -57,7 +57,7 @@ public class StringSplitConverterStepBindingHandler extends AbstractElementBindi
}
/**
* @see org.x4o.xml.element.ElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
public void bindChild(Element childElement,StringSplitConverterStep parent, Object childObject) throws ElementBindingHandlerException {
if (childObject instanceof ObjectConverter) {

View file

@ -50,7 +50,7 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace
/**
* @param language The elementLanguage of this provider.
* @param elementNamespaceContext The elementNamespaceContext for this provider.
* @see org.x4o.xml.element.ElementNamespaceInstanceProvider#start(org.x4o.xml.lang.X4OLanguageContext, org.x4o.xml.element.ElementNamespaceContext)
* @see org.x4o.xml.element.ElementNamespaceInstanceProvider#start(org.x4o.xml.lang.X4OLanguage, org.x4o.xml.element.ElementNamespaceContext)
*/
public void start(X4OLanguage language,ElementNamespaceContext elementNamespaceContext) {
this.elementNamespaceContext=elementNamespaceContext;
@ -58,12 +58,13 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace
}
/**
* @param languageContext The language context for which we create the Element instance.
* @param tag The xml tag to create an Element instance for.
* @return The Element to handle the given tag.
* @throws ElementNamespaceInstanceProviderException
* @see org.x4o.xml.element.ElementNamespaceInstanceProvider#createElementInstance(java.lang.String)
* @see org.x4o.xml.element.ElementNamespaceInstanceProvider#createElementInstance(org.x4o.xml.lang.X4OLanguageContext,java.lang.String)
*/
public Element createElementInstance(X4OLanguageContext elementLanguage,String tag) throws ElementNamespaceInstanceProviderException {
public Element createElementInstance(X4OLanguageContext languageContext,String tag) throws ElementNamespaceInstanceProviderException {
ElementClass elementClass = elementNamespaceContext.getElementClass(tag);
Element element = null;
@ -79,7 +80,7 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace
}
element = (Element) obj;
} else {
element = (Element)X4OLanguageClassLoader.newInstance((elementLanguage.getLanguage().getLanguageConfiguration().getDefaultElement()));
element = (Element)X4OLanguageClassLoader.newInstance((languageContext.getLanguage().getLanguageConfiguration().getDefaultElement()));
}
if (elementClass.getObjectClass()!=null) {
@ -93,7 +94,7 @@ public class DefaultElementNamespaceInstanceProvider implements ElementNamespace
throw new ElementNamespaceInstanceProviderException(this,"Error while providing Element: "+e.getMessage(),e);
} */
element.setElementClass(elementClass);
element.setLanguageContext(elementLanguage);
element.setLanguageContext(languageContext);
return element;
}
}

View file

@ -49,12 +49,15 @@ public interface ElementBindingHandler extends ElementMetaBase {
/**
* Do the binding of this child to the parent object.
* @param parentObject The parentObject of this childElement.
* @param childObject The childObject of this childElement.
* @param childElement The child element to bind to the parent.'
* @throws ElementBindingHandlerException When binding could not happen.
*/
void bindChild(Element childElement) throws ElementBindingHandlerException;
/**
* Creates the childeren of the parent object.
* @param parentElement The parent element to create the childeren from.'
* @throws ElementBindingHandlerException When binding could not happen.
*/
void createChilderen(Element parentElement) throws ElementBindingHandlerException;
}

View file

@ -72,7 +72,7 @@ abstract public class AbstractX4OReader<T> extends AbstractX4OReaderContext<T> i
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public T readFile(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException {
if (fileName==null) {
@ -90,7 +90,7 @@ abstract public class AbstractX4OReader<T> extends AbstractX4OReaderContext<T> i
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public T readFile(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException {
if (file==null) {
@ -122,6 +122,7 @@ abstract public class AbstractX4OReader<T> extends AbstractX4OReaderContext<T> i
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public T readResource(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException {
if (resourceName==null) {
@ -156,7 +157,7 @@ abstract public class AbstractX4OReader<T> extends AbstractX4OReaderContext<T> i
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public T readString(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException {
if (xmlString==null) {
@ -173,7 +174,7 @@ abstract public class AbstractX4OReader<T> extends AbstractX4OReaderContext<T> i
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public T readUrl(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException {
if (url==null) {

View file

@ -57,7 +57,7 @@ abstract public class AbstractX4OReaderContext<T> extends AbstractX4OConnection
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public X4OLanguageContext readFileContext(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException {
if (fileName==null) {
@ -75,7 +75,7 @@ abstract public class AbstractX4OReaderContext<T> extends AbstractX4OConnection
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public X4OLanguageContext readFileContext(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException {
if (file==null) {
@ -107,6 +107,7 @@ abstract public class AbstractX4OReaderContext<T> extends AbstractX4OConnection
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public X4OLanguageContext readResourceContext(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException {
if (resourceName==null) {
@ -141,7 +142,7 @@ abstract public class AbstractX4OReaderContext<T> extends AbstractX4OConnection
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public X4OLanguageContext readStringContext(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException {
if (xmlString==null) {
@ -158,7 +159,7 @@ abstract public class AbstractX4OReaderContext<T> extends AbstractX4OConnection
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.sax.AbstractXMLreadr#read(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
public X4OLanguageContext readUrlContext(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException {
if (url==null) {

View file

@ -61,7 +61,7 @@ public interface X4OReader<T> extends X4OConnection {
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
T readFile(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException;
@ -74,7 +74,7 @@ public interface X4OReader<T> extends X4OConnection {
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
T readFile(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException;
@ -87,6 +87,7 @@ public interface X4OReader<T> extends X4OConnection {
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
T readResource(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException;
@ -97,7 +98,7 @@ public interface X4OReader<T> extends X4OConnection {
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
T readString(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException;
@ -108,7 +109,7 @@ public interface X4OReader<T> extends X4OConnection {
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
T readUrl(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException;
}

View file

@ -63,7 +63,7 @@ public interface X4OReaderContext<T> extends X4OReader<T> {
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
X4OLanguageContext readFileContext(String fileName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException;
@ -76,7 +76,7 @@ public interface X4OReaderContext<T> extends X4OReader<T> {
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
X4OLanguageContext readFileContext(File file) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException;
@ -89,6 +89,7 @@ public interface X4OReaderContext<T> extends X4OReader<T> {
* @throws NullPointerException
* @throws SAXException
* @throws IOException
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
X4OLanguageContext readResourceContext(String resourceName) throws ParserConfigurationException,FileNotFoundException,SecurityException,NullPointerException,SAXException,IOException;
@ -99,7 +100,7 @@ public interface X4OReaderContext<T> extends X4OReader<T> {
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
X4OLanguageContext readStringContext(String xmlString) throws ParserConfigurationException,SAXException,IOException,NullPointerException;
@ -110,7 +111,7 @@ public interface X4OReaderContext<T> extends X4OReader<T> {
* @throws SAXException
* @throws IOException
* @throws NullPointerException
* @see org.x4o.xml.io.AbstractX4OReader#parse(java.io.InputStream,java.lang.String,java.net.URL)
* @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL)
*/
X4OLanguageContext readUrlContext(URL url) throws ParserConfigurationException,SAXException,IOException,NullPointerException;
}

View file

@ -38,31 +38,31 @@ import org.xml.sax.SAXParseException;
*/
public class X4OErrorHandler implements ErrorHandler {
private X4OLanguageContext elementContext = null;
private X4OLanguageContext languageContext = null;
private ErrorHandler errorHandler = null;
/**
* Construct a new SAXErrorPrinter
* @param language The language to get errors to.
* @param languageContext The language to get errors to.
*/
public X4OErrorHandler(X4OLanguageContext elementContext) {
if (elementContext==null) {
throw new NullPointerException("Can't debug and proxy errors with null elementContext.");
public X4OErrorHandler(X4OLanguageContext languageContext) {
if (languageContext==null) {
throw new NullPointerException("Can't debug and proxy errors with null languageContext.");
}
this.elementContext=elementContext;
this.errorHandler=(ErrorHandler)elementContext.getLanguageProperty(X4OLanguageProperty.CONFIG_ERROR_HANDLER);
this.languageContext=languageContext;
this.errorHandler=(ErrorHandler)languageContext.getLanguageProperty(X4OLanguageProperty.CONFIG_ERROR_HANDLER);
}
/**
* Prints the error message to debug output.
*/
private void printError(boolean isError, SAXParseException exception) throws SAXException {
if (elementContext.hasX4ODebugWriter()==false) {
if (languageContext.hasX4ODebugWriter()==false) {
return;
}
String message = printErrorString(isError,exception);
try {
elementContext.getX4ODebugWriter().debugPhaseMessage(message, X4OErrorHandler.class);
languageContext.getX4ODebugWriter().debugPhaseMessage(message, X4OErrorHandler.class);
} catch (ElementException e) {
throw new SAXException(e);
}

View file

@ -260,7 +260,7 @@ public class XMLWriter extends DefaultHandler2 {
public void endElement(String uri, String localName, String name) throws SAXException {
if (startElement!=null) {
String tag = startElement.toString();
write(tag.substring(0,tag.length()-1));
write(tag.substring(0,tag.length()-1));// rm normal close
write(XMLConstants.TAG_CLOSE_EMPTY);
startElement=null;
indent--;

View file

@ -152,7 +152,7 @@ public abstract class AbstractX4OLanguageContext implements X4OLanguageContextLo
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#setCurrentPhase(org.x4o.xml.lang.phase.X4OPhase)
* @see org.x4o.xml.lang.X4OLanguageContextLocal#setCurrentPhase(org.x4o.xml.lang.phase.X4OPhase)
*/
public void setCurrentPhase(X4OPhase currentX4OPhase) {
this.currentX4OPhase = currentX4OPhase;
@ -205,14 +205,14 @@ public abstract class AbstractX4OLanguageContext implements X4OLanguageContextLo
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getLanguageProperty(org.x4o.xml.lang.X4OLanguageProperty)
*
*/
public Object getLanguageProperty(X4OLanguageProperty property) {
return getLanguageProperty(property.toUri());
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#setLanguageProperty(org.x4o.xml.lang.X4OLanguageProperty, java.lang.Object)
*
*/
public void setLanguageProperty(X4OLanguageProperty property, Object value) {
if (property.isValueValid(value)==false) {
@ -222,7 +222,7 @@ public abstract class AbstractX4OLanguageContext implements X4OLanguageContextLo
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getLanguagePropertyBoolean(org.x4o.xml.lang.X4OLanguageProperty)
*
*/
public boolean getLanguagePropertyBoolean(X4OLanguageProperty property) {
Object value = getLanguageProperty(property);
@ -233,7 +233,7 @@ public abstract class AbstractX4OLanguageContext implements X4OLanguageContextLo
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getLanguagePropertyInteger(org.x4o.xml.lang.X4OLanguageProperty)
*
*/
public int getLanguagePropertyInteger(X4OLanguageProperty property) {
Object value = getLanguageProperty(property);
@ -252,21 +252,21 @@ public abstract class AbstractX4OLanguageContext implements X4OLanguageContextLo
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getX4ODebugWriter()
* @see org.x4o.xml.lang.X4OLanguageContext#getX4ODebugWriter()
*/
public X4ODebugWriter getX4ODebugWriter() {
return debugWriter;
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#hasX4ODebugWriter()
* @see org.x4o.xml.lang.X4OLanguageContext#hasX4ODebugWriter()
*/
public boolean hasX4ODebugWriter() {
return debugWriter!=null;
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#setX4ODebugWriter(org.x4o.xml.io.sax.X4ODebugWriter)
* @see org.x4o.xml.lang.X4OLanguageContextLocal#setX4ODebugWriter(org.x4o.xml.io.sax.X4ODebugWriter)
*/
public void setX4ODebugWriter(X4ODebugWriter debugWriter) {
this.debugWriter=debugWriter;

View file

@ -73,7 +73,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#addLanguageModule(org.x4o.xml.lang.X4OLanguageModule)
* @see org.x4o.xml.lang.X4OLanguageLocal#addLanguageModule(org.x4o.xml.lang.X4OLanguageModule)
*/
public void addLanguageModule(X4OLanguageModule elementLanguageModule) {
if (elementLanguageModule.getId()==null) {
@ -83,7 +83,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#getLanguageModules()
* @see org.x4o.xml.lang.X4OLanguage#getLanguageModules()
*/
public List<X4OLanguageModule> getLanguageModules() {
return elementLanguageModules;
@ -132,7 +132,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguage#createElementInstance(java.lang.Class)
* @see org.x4o.xml.lang.X4OLanguage#createElementInstance(org.x4o.xml.lang.X4OLanguageContext,java.lang.Class)
*/
public Element createElementInstance(X4OLanguageContext context,Class<?> objectClass) {
for (X4OLanguageModule modContext:getLanguageModules()) {
@ -152,7 +152,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#findElementBindingHandlers(java.lang.Object)
* @see org.x4o.xml.lang.X4OLanguage#findElementBindingHandlers(java.lang.Object)
*/
public List<ElementBindingHandler> findElementBindingHandlers(Object parent) {
List<ElementBindingHandler> result = new ArrayList<ElementBindingHandler>(50);
@ -167,7 +167,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#findElementBindingHandlers(java.lang.Object,java.lang.Object)
* @see org.x4o.xml.lang.X4OLanguage#findElementBindingHandlers(java.lang.Object,java.lang.Object)
*/
public List<ElementBindingHandler> findElementBindingHandlers(Object parent,Object child) {
List<ElementBindingHandler> result = new ArrayList<ElementBindingHandler>(50);
@ -213,7 +213,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#findElementInterfaces(java.lang.Object)
* @see org.x4o.xml.lang.X4OLanguage#findElementInterfaces(java.lang.Object)
*/
public List<ElementInterface> findElementInterfaces(Object elementObject) {
if (elementObject==null) {
@ -238,7 +238,7 @@ public class DefaultX4OLanguage implements X4OLanguageLocal {
}
/**
* @see org.x4o.xml.lang.X4OLanguageContext#findElementNamespaceContext(java.lang.String)
* @see org.x4o.xml.lang.X4OLanguage#findElementNamespaceContext(java.lang.String)
*/
public ElementNamespaceContext findElementNamespaceContext(String namespaceUri) {

View file

@ -160,14 +160,14 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultX4OLanguageVersionFilter()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultLanguageVersionFilter()
*/
public Class<?> getDefaultLanguageVersionFilter() {
return DefaultX4OLanguageVersionFilter.class;
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultX4OLanguageLoader()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getDefaultLanguageLoader()
*/
public Class<?> getDefaultLanguageLoader() {
return DefaultX4OLanguageLoader.class;
@ -181,7 +181,7 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserProperties()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserProperties(org.x4o.xml.lang.X4OLanguageContext)
*/
public Map<String, Object> getSAXParserProperties(X4OLanguageContext elementContext) {
Map<String,Object> saxParserProperties = new HashMap<String,Object>(1);
@ -189,7 +189,7 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserPropertiesOptional()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserPropertiesOptional(org.x4o.xml.lang.X4OLanguageContext)
*/
public Map<String, Object> getSAXParserPropertiesOptional(X4OLanguageContext elementContext) {
Map<String,Object> saxParserProperties = new HashMap<String,Object>(1);
@ -198,7 +198,7 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeatures()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeatures(org.x4o.xml.lang.X4OLanguageContext)
*/
public Map<String, Boolean> getSAXParserFeatures(X4OLanguageContext elementContext) {
@ -247,7 +247,7 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeaturesOptional()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeaturesOptional(org.x4o.xml.lang.X4OLanguageContext)
*/
public Map<String, Boolean> getSAXParserFeaturesOptional(X4OLanguageContext elementContext) {
Map<String,Boolean> saxParserFeatures = new HashMap<String,Boolean>(20);
@ -271,7 +271,7 @@ public class DefaultX4OLanguageConfiguration implements X4OLanguageConfiguration
}
/**
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeaturesRequired()
* @see org.x4o.xml.lang.X4OLanguageConfiguration#getSAXParserFeaturesRequired(org.x4o.xml.lang.X4OLanguageContext)
*/
public List<String> getSAXParserFeaturesRequired(X4OLanguageContext elementContext) {
List<String> result = new ArrayList<String>(5);

View file

@ -80,7 +80,7 @@ public class DefaultX4OLanguageLoader implements X4OLanguageLoader {
}
/**
* @see org.x4o.xml.lang.X4OLanguageLoader#loadLanguage(org.x4o.xml.element.ElementLanguage, java.lang.String, java.lang.String)
* @see org.x4o.xml.lang.X4OLanguageLoader#loadLanguage(org.x4o.xml.lang.X4OLanguageLocal, java.lang.String, java.lang.String)
*/
public void loadLanguage(X4OLanguageLocal languageLocal, String language,String languageVersion) throws X4OLanguageLoaderException {
try {
@ -156,7 +156,7 @@ public class DefaultX4OLanguageLoader implements X4OLanguageLoader {
/**
* Loads all modules of an language.
* @param elementLanguage The ElementLanguage to load for.
* @param languageLocal The ElementLanguage to load for.
* @param language The language to load.
*/
protected void loadLanguageModules(X4OLanguageLocal languageLocal,String language) throws IOException, SAXException {

View file

@ -62,15 +62,16 @@ public interface X4OLanguage {
X4OLanguageConfiguration getLanguageConfiguration();
/**
* Creates and filles the inital element language used to store the language.
* Creates and fills the initial element language used to store the language.
* @return The newly created ElementLanguage.
*/
X4OLanguageContext createLanguageContext(X4ODriver<?> driver);
/**
* Search language for object and create elememt for it.
* @param object The object to search for.
* @return Returns an new Elememt instance for the object.
* Search language for object and create element for it.
* @param context The X4O language context to create for.
* @param objectClass The object to search for.
* @return Returns an new Element instance for the object.
*/
Element createElementInstance(X4OLanguageContext context,Class<?> objectClass);

View file

@ -33,10 +33,10 @@ public interface X4OLanguageLoader {
/**
* Loads the language modules.
* @param elementLanguage The elementLanguage to load the module in.
* @param language The language to load.
* @param languageLocal The elementLanguage to load the module in.
* @param languageName The language name to load.
* @param languageVersion The language version to load.
* @throws X4OLanguageLoaderException When there is an error.
*/
void loadLanguage(X4OLanguageLocal languageLocal,String language,String languageVersion) throws X4OLanguageLoaderException;
void loadLanguage(X4OLanguageLocal languageLocal,String languageName,String languageVersion) throws X4OLanguageLoaderException;
}

View file

@ -37,8 +37,8 @@ public interface X4OLanguageModuleLoaderSibling extends X4OLanguageModuleLoader
/**
* Loads in the sibling language.
* @param languageLocal The ElementLanguage for which we load an sibling.
* @param loader The loader to use to load the x4o languages.
* @param languageLoader The loader to use to load the x4o languages.
* @throws X4OLanguageLoaderException Gets thrown when there is an error loading the sibling language.
*/
void loadLanguageSibling(X4OLanguageLocal languageLocal,X4OLanguageLoader loader) throws X4OLanguageLoaderException;
void loadLanguageSibling(X4OLanguageLocal languageLocal,X4OLanguageLoader languageLoader) throws X4OLanguageLoaderException;
}

View file

@ -46,8 +46,7 @@ public class DefaultX4OPhaseManager implements X4OPhaseManager {
private List<X4OPhase> x4oPhases = null;
/**
* Local package constructor.
* @param elementLanguage The ElementLanguage to run the phases on.
* Constructor.
*/
public DefaultX4OPhaseManager() {
x4oPhases = new ArrayList<X4OPhase>(25);

View file

@ -109,4 +109,127 @@ public class X4ODriverManagerTest extends TestCase {
long loopTime = System.currentTimeMillis() - startTime;
assertEquals("Language list loop is slow;"+loopTime,true, loopTime<500);
}
public void testRegisterDriverNull() throws Exception {
Exception e = null;
try {
X4ODriverManager.registerX4ODriver(null);
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",NullPointerException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("null"));
}
public void testRegisterDriverNameNull() throws Exception {
Exception e = null;
try {
X4ODriverManager.registerX4ODriver(new X4ODriver<Object>() {
@Override public String[] getLanguageVersions() { return new String[]{"1.0"}; }
@Override public String getLanguageName() { return null; }
});
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",NullPointerException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("null"));
}
public void testRegisterDriverNameEmpty() throws Exception {
Exception e = null;
try {
X4ODriverManager.registerX4ODriver(new X4ODriver<Object>() {
@Override public String[] getLanguageVersions() { return new String[]{"1.0"}; }
@Override public String getLanguageName() { return ""; }
});
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",IllegalArgumentException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("empty"));
}
public void testRegisterDriverVersionNull() throws Exception {
Exception e = null;
try {
X4ODriverManager.registerX4ODriver(new X4ODriver<Object>() {
@Override public String[] getLanguageVersions() { return null; }
@Override public String getLanguageName() { return "junit-driver-test"; }
});
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",NullPointerException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("null"));
}
public void testRegisterDriverVersionEmpty() throws Exception {
Exception e = null;
try {
X4ODriverManager.registerX4ODriver(new X4ODriver<Object>() {
@Override public String[] getLanguageVersions() { return new String[]{}; }
@Override public String getLanguageName() { return "junit-driver-test"; }
});
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",IllegalArgumentException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("empty"));
}
public void testDeregisterDriverNull() throws Exception {
Exception e = null;
try {
X4ODriverManager.deregisterX4ODriver(null);
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",NullPointerException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("null"));
}
public void testDeregisterDriverNameNull() throws Exception {
Exception e = null;
try {
X4ODriverManager.deregisterX4ODriver(new X4ODriver<Object>() {
@Override public String[] getLanguageVersions() { return new String[]{"1.0"}; }
@Override public String getLanguageName() { return null; }
});
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",NullPointerException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("null"));
}
public void testDeregisterDriverInstance() throws Exception {
Exception e = null;
try {
X4ODriver<?> driver = new X4ODriver<Object>() {
@Override public String[] getLanguageVersions() { return new String[]{"1.0"}; }
@Override public String getLanguageName() { return "junit-driver-test"; }
};
X4ODriverManager.registerX4ODriver(driver);
assertEquals(driver.hashCode(), X4ODriverManager.getX4ODriver("junit-driver-test").hashCode());
X4ODriverManager.deregisterX4ODriver(driver);
X4ODriverManager.getX4ODriver("junit-driver-test");
} catch (Exception catchE) {
e = catchE;
}
assertNotNull("No exception",e);
assertEquals("Wrong exception class",IllegalArgumentException.class, e.getClass());
assertTrue("Wrong exception message",e.getMessage().contains("junit-driver-test"));
}
}

View file

@ -109,7 +109,7 @@ public class EldParserTest extends TestCase {
assertTrue("No elementConfigurator tag found in core eld.", resultTags.contains("elementConfigurator"));
*/
} catch (Exception e) {
e.printStackTrace();
//e.printStackTrace();
} finally {
// parser.doReleasePhaseManual();
}

View file

@ -53,13 +53,13 @@ public class X4OWriteLanguageDocExecutor {
String arg = arguIterator.next();
if ("-path".equals(arg) || "-p".equals(arg)) {
if (arguIterator.hasNext()==false) {
System.out.println("No argument for "+arg+" given.");
System.err.println("No argument for "+arg+" given.");
System.exit(1);
return;
}
File schemaBasePath = new File(arguIterator.next());
if (schemaBasePath.exists()==false) {
System.out.println("path does not exists; "+schemaBasePath);
System.err.println("path does not exists; "+schemaBasePath);
System.exit(1);
return;
}
@ -68,7 +68,7 @@ public class X4OWriteLanguageDocExecutor {
}
if ("-language".equals(arg) || "-l".equals(arg)) {
if (arguIterator.hasNext()==false) {
System.out.println("No argument for "+arg+" given.");
System.err.println("No argument for "+arg+" given.");
System.exit(1);
return;
}
@ -80,7 +80,7 @@ public class X4OWriteLanguageDocExecutor {
try {
languageSchema.execute();
} catch (ElementException e) {
System.out.println("Error while schema writing: "+e.getMessage());
System.err.println("Error while schema writing: "+e.getMessage());
e.printStackTrace();
System.exit(1);
return;

View file

@ -47,27 +47,27 @@ public class MetaLanguageSiblingLoader implements X4OLanguageModuleLoaderSibling
/**
* Loads an ElementLanguageModule.
* @param language The ElementLanguage to load for.
* @param elementLanguageModule The ElementLanguageModule to load into.
* @param languageModule The ElementLanguageModule to load into.
* @throws X4OLanguageModuleLoaderException Is thrown when meta language could not be loaded.
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.element.ElementLanguage, org.x4o.xml.lang.X4OLanguageModule)
* @see org.x4o.xml.lang.X4OLanguageModuleLoader#loadLanguageModule(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageModule)
*/
public void loadLanguageModule(X4OLanguageLocal languageLocal,X4OLanguageModule elementLanguageModule) throws X4OLanguageModuleLoaderException {
elementLanguageModule.setId(META_LANGUAGE);
elementLanguageModule.setName(META_LANGUAGE);
elementLanguageModule.setProviderName(MetaLanguageSiblingLoader.class.getSimpleName());
elementLanguageModule.setDescription("X4O Meta Language");
public void loadLanguageModule(X4OLanguageLocal language,X4OLanguageModule languageModule) throws X4OLanguageModuleLoaderException {
languageModule.setId(META_LANGUAGE);
languageModule.setName(META_LANGUAGE);
languageModule.setProviderName(MetaLanguageSiblingLoader.class.getSimpleName());
languageModule.setDescription("X4O Meta Language");
}
/**
* Loads an sibling language.
* @param elementLanguage The ElementLanguage to load for.
* @param loader The x4o language loader.
* @param language The ElementLanguage to load for.
* @param languageLoader The x4o language loader.
* @throws X4OLanguageLoaderException
* @see org.x4o.xml.lang.X4OLanguageModuleLoaderSibling#loadLanguageSibling(org.x4o.xml.element.ElementLanguage, org.x4o.xml.lang.X4OLanguageLoader)
* @see org.x4o.xml.lang.X4OLanguageModuleLoaderSibling#loadLanguageSibling(org.x4o.xml.lang.X4OLanguageLocal, org.x4o.xml.lang.X4OLanguageLoader)
*/
public void loadLanguageSibling(X4OLanguageLocal languageLocal,X4OLanguageLoader loader) throws X4OLanguageLoaderException {
public void loadLanguageSibling(X4OLanguageLocal language,X4OLanguageLoader languageLoader) throws X4OLanguageLoaderException {
// Load the meta language.
loader.loadLanguage(languageLocal, META_LANGUAGE, META_LANGUAGE_VERSION);
languageLoader.loadLanguage(language, META_LANGUAGE, META_LANGUAGE_VERSION);
}
}

View file

@ -71,7 +71,7 @@
</build>
<profiles>
<profile>
<id>update-schema-cel</id>
<id>ant-update-schema-cel</id>
<build>
<plugins>
<plugin>
@ -106,7 +106,7 @@
</build>
</profile>
<profile>
<id>update-schema-eld</id>
<id>ant-update-schema-eld</id>
<build>
<plugins>
<plugin>
@ -141,7 +141,7 @@
</build>
</profile>
<profile>
<id>site-elddoc2</id>
<id>ant-site-elddoc</id>
<build>
<plugins>
<plugin>

View file

@ -69,7 +69,7 @@
</build>
<profiles>
<profile>
<id>site-elddoc</id>
<id>build-site-x4o-support</id>
<build>
<plugins>
<plugin>
@ -78,10 +78,10 @@
<version>${project.version}</version>
<executions>
<execution>
<id>site-elddoc-maven</id>
<id>build-site-x4o-support</id>
<phase>pre-site</phase>
<configuration>
<outputDirectory>${basedir}/../../target/site/elddocs</outputDirectory>
<outputDirectory>${basedir}/../../target/site/x4o-support</outputDirectory>
<languages>
<cel>ALL</cel>
<eld>ALL</eld>
@ -91,6 +91,7 @@
</configuration>
<goals>
<goal>write-language-doc</goal>
<goal>write-language-schema</goal>
</goals>
</execution>
</executions>

View file

@ -24,8 +24,7 @@
package org.x4o.plugin.maven;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import org.apache.maven.plugin.AbstractMojo;
@ -35,49 +34,77 @@ import org.x4o.xml.X4ODriver;
import org.x4o.xml.X4ODriverManager;
/**
* X4OWriteLanguageDocMojo creates docs for language.
* AbstractX4OLanguageMojo can perform a task on languages and versions.
*
* @author Willem Cazander
* @version 1.0 Apr 9, 2013
*/
public abstract class AbstractX4OLanguageMojo extends AbstractMojo {
@Parameter(property="outputDirectory")
private final static String DEFAULT_OUTPUT_DIRECTORY = "target/x4o";
@Parameter(property="outputDirectory",defaultValue=DEFAULT_OUTPUT_DIRECTORY)
private File outputDirectory;
@Parameter(required=true,property="languages")
@Parameter
private Map<String,String> languages;
@Parameter(property="languages")
private String languageCommandLineString;
@Parameter(defaultValue="false",property="verbose")
private boolean verbose = false;
@Parameter(defaultValue="true",property="failOnError")
private boolean failOnError = true;
abstract String getLanguageTaskDirectoryLabel();
abstract String getLanguageTaskName();
abstract void executeLanguageTask(String languageName,String languageVersion,File outputDirectory) throws MojoExecutionException;
private void executeLanguageTask() throws MojoExecutionException {
if (outputDirectory==null) {
throw new MojoExecutionException("outputDirectory attribute is not set.");
}
if (languages==null) {
throw new MojoExecutionException("languages attribute is not set.");
languages = new HashMap<String,String>(10); // maven does not support setting map on cmd line ?
}
if (languages.size()==0) {
throw new MojoExecutionException("languages attribute is empty.");
if (outputDirectory==null) {
outputDirectory = new File(DEFAULT_OUTPUT_DIRECTORY);
}
long startTime = System.currentTimeMillis();
if (verbose) {
getLog().info("Starting "+getLanguageTaskName());
getLog().info("Output directory: "+outputDirectory);
getLog().info("Verbose: "+verbose);
getLog().info("Fail on error: "+failOnError);
}
if (outputDirectory.exists()==false) {
outputDirectory.mkdir();
outputDirectory.mkdirs(); // incl parents
if (verbose) {
getLog().info("Created directory: "+outputDirectory);
}
}
if (languageCommandLineString!=null && languageCommandLineString.startsWith("{") && languageCommandLineString.endsWith("}")) {
languages.clear();
String langString = languageCommandLineString.substring(1,languageCommandLineString.length()-1);
String[] lang = langString.split(",");
for (String l:lang) {
String[] ll = l.split("=");
if (ll.length!=2) {
getLog().warn("Wrong langauge key split: '"+l+"' of languageString: '"+languageCommandLineString+"'");
continue;
}
String langName = ll[0];
String langVersion = ll[1];
languages.put(langName,langVersion);
}
}
if (languages.size()==0) {
if (verbose) {
getLog().info("Defaulting to all languages in classpath.");
}
for (String lang:X4ODriverManager.getX4OLanguages()) {
languages.put(lang, "ALL");
}
}
for (String languageName:languages.keySet()) {
String languageVersions = languages.get(languageName);
if (languageVersions.contains("*") || languageVersions.contains("ALL")) {
@ -96,12 +123,22 @@ public abstract class AbstractX4OLanguageMojo extends AbstractMojo {
executeLanguageTask(languageName,languageVersions); // only one version
}
}
long stopTime = System.currentTimeMillis();
getLog().info("Done "+getLanguageTaskName()+" in "+(stopTime-startTime)+" ms.");
}
private void executeLanguageTask(String languageName,String languageVersion) throws MojoExecutionException {
File outputLanguagPath = new File(outputDirectory.getAbsolutePath()+File.separatorChar+languageName+"-"+languageVersion);
long startTime = System.currentTimeMillis();
if (verbose) {
getLog().info("Starting "+getLanguageTaskName()+" for "+languageName+":"+languageVersion);
}
StringBuffer buf = new StringBuffer(100);
buf.append(outputDirectory.getAbsolutePath());
buf.append(File.separatorChar);
buf.append(getLanguageTaskDirectoryLabel());
buf.append("-");
buf.append(languageName);
buf.append("-");
buf.append(languageVersion);
File outputLanguagPath = new File(buf.toString());
if (outputLanguagPath.exists()==false) {
outputLanguagPath.mkdir();
if (verbose) {
@ -109,18 +146,12 @@ public abstract class AbstractX4OLanguageMojo extends AbstractMojo {
}
}
executeLanguageTask(languageName,languageVersion,outputLanguagPath);
long stopTime = System.currentTimeMillis();
getLog().info("Done "+getLanguageTaskName()+" for "+languageName+":"+languageVersion+" in "+(stopTime-startTime)+" ms.");
}
public void execute() throws MojoExecutionException {
try {
if (verbose) {
if (languages!=null) {
getLog().info("X4O Languages: "+languages.size());
}
getLog().info("Output directory: "+outputDirectory);
getLog().info("Verbose: "+verbose);
getLog().info("Fail on error: "+failOnError);
}
executeLanguageTask();
} catch (MojoExecutionException e) {
if (failOnError) {
@ -153,7 +184,9 @@ public abstract class AbstractX4OLanguageMojo extends AbstractMojo {
}
/**
* @param languages the languages to set
* Adds an language with version.
* @param languageName the languageName to set
* @param languageVersion the languageVersion to set
*/
public void addLanguage(String languageName,String languageVersion) {
languages.put(languageName,languageVersion);

View file

@ -43,6 +43,10 @@ public class X4OWriteLanguageDocMojo extends AbstractX4OLanguageMojo {
static public final String GOAL = "write-language-doc";
String getLanguageTaskDirectoryLabel() {
return "doc";
}
String getLanguageTaskName() {
return "X4O Write language documentation";
}

View file

@ -43,6 +43,10 @@ public class X4OWriteLanguageSchemaMojo extends AbstractX4OLanguageMojo {
static public final String GOAL = "write-language-schema";
String getLanguageTaskDirectoryLabel() {
return "xsd";
}
String getLanguageTaskName() {
return "X4O Write language schema";
}

View file

@ -45,51 +45,38 @@ public class X4OWriteLanguageDocMojoTest extends AbstractMojoTestCase {
super.tearDown(); // required
}
private void executeGoal() throws Exception {
File pom = getTestFile( "src/test/resources/junit/test-write-language-doc.pom" );
assertNotNull( pom );
assertTrue( pom.exists() );
X4OWriteLanguageDocMojo mojo = (X4OWriteLanguageDocMojo) lookupMojo( X4OWriteLanguageDocMojo.GOAL, pom );
//mojo.s
assertNotNull( mojo );
private void executeGoal(String goal,String testFile) throws Exception {
File pom = getTestFile(testFile);
assertNotNull(pom);
assertTrue(pom.exists());
X4OWriteLanguageDocMojo mojo = (X4OWriteLanguageDocMojo) lookupMojo(goal,pom);
assertNotNull(mojo);
mojo.execute();
}
public void testEldDocCel() throws Exception {
executeGoal(); //"test-elddoc-cel"
File testDir = new File("target/test-elddoc/cel");
//int files = testDir.listFiles().length;
//assertEquals("Should created more then two files", true, files>2);
}
/*
public void testEldDocEld() {
executeTarget("test-elddoc-eld");
File testDir = new File("target/test-elddoc/eld");
int files = testDir.listFiles().length;
public void testConfAllWriteDoc() throws Exception {
executeGoal(X4OWriteLanguageDocMojo.GOAL,"src/test/resources/junit/test-plugin-conf-all.pom");
File outputDir = new File("target/jtest/test-plugin-conf-all/doc-eld-1.0");
assertTrue(outputDir.exists());
int files = outputDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
public void testEldDocEldVerbose() {
executeTarget("test-elddoc-cel-verbose");
assertLogContaining("Verbose:");
public void testConfLangWriteDoc() throws Exception {
executeGoal(X4OWriteLanguageDocMojo.GOAL,"src/test/resources/junit/test-plugin-conf-lang.pom");
File outputDir = new File("target/jtest/test-plugin-conf-lang/doc-cel-1.0");
int files = outputDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
public void testFailAllMissing() {
expectBuildException("test-fail-all", "Should get exception with no attributes.");
public void testConfDefaultsWriteDoc() throws Exception {
executeGoal(X4OWriteLanguageDocMojo.GOAL,"src/test/resources/junit/test-plugin-defaults.pom");
File outputDir = new File("target/x4o/doc-cel-1.0");
int files = outputDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
outputDir = new File("target/x4o/doc-eld-1.0");
files = outputDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
public void testFailBasePath() {
expectBuildException("test-fail-destdir", "Should get exception id destdir is not set.");
}
public void testFailBasePathError() {
expectBuildException("test-fail-destdir-error", "Should get exception id destdir does not exists.");
}
public void testFailLanguage() {
expectBuildException("test-fail-language", "Should get exception id language is not set.");
}
public void testFailLanguageError() {
expectBuildException("test-fail-language-error", "Should get exception id language throws error.");
}
*/
}

View file

@ -0,0 +1,72 @@
/*
* Copyright (c) 2004-2012, Willem Cazander
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.x4o.plugin.maven;
import java.io.File;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
/**
* X4OWriteLanguageSchemaMojoTest.
*
* @author Willem Cazander
* @version 1.0 Apr 14, 2013
*/
public class X4OWriteLanguageSchemaMojoTest extends AbstractMojoTestCase {
private void executeGoal(String goal,String testFile) throws Exception {
File pom = getTestFile(testFile);
assertNotNull(pom);
assertTrue(pom.exists());
X4OWriteLanguageSchemaMojo mojo = (X4OWriteLanguageSchemaMojo) lookupMojo(goal,pom);
assertNotNull(mojo);
mojo.execute();
}
public void testConfAllWriteSchema() throws Exception {
executeGoal(X4OWriteLanguageSchemaMojo.GOAL,"src/test/resources/junit/test-plugin-conf-all.pom");
File outputDir = new File("target/jtest/test-plugin-conf-all/xsd-eld-1.0");
assertTrue(outputDir.exists());
int files = outputDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
public void testConfLangWriteSchema() throws Exception {
executeGoal(X4OWriteLanguageSchemaMojo.GOAL,"src/test/resources/junit/test-plugin-conf-lang.pom");
File outputDir = new File("target/jtest/test-plugin-conf-lang/xsd-cel-1.0");
int files = outputDir.listFiles().length;
assertEquals("Should created more then one file", true, files>1);
}
public void testConfDefaultsWriteSchema() throws Exception {
executeGoal(X4OWriteLanguageSchemaMojo.GOAL,"src/test/resources/junit/test-plugin-defaults.pom");
File outputDir = new File("target/x4o/xsd-cel-1.0");
int files = outputDir.listFiles().length;
assertEquals("Should created more then one file", true, files>1);
outputDir = new File("target/x4o/xsd-eld-1.0");
files = outputDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
}

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004-2012, Willem Cazander
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.x4o.plugin.junit</groupId>
<artifactId>x4o-plugin-maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>x4o-plugin-maven-test</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>x4o-plugin-maven</artifactId>
<configuration>
<outputDirectory>target/jtest/test-plugin-conf-all</outputDirectory>
<languages>
<eld>1.0</eld>
</languages>
<verbose>false</verbose>
<failOnError>false</failOnError>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004-2012, Willem Cazander
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.x4o.plugin.junit</groupId>
<artifactId>x4o-plugin-maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>x4o-plugin-maven-test</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>x4o-plugin-maven</artifactId>
<configuration>
<outputDirectory>target/jtest/test-plugin-conf-lang</outputDirectory>
<languages>
<cel>1.0</cel>
</languages>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004-2012, Willem Cazander
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.x4o.plugin.junit</groupId>
<artifactId>x4o-plugin-maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>x4o-plugin-maven-test</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>x4o-plugin-maven</artifactId>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -1,33 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.x4o.plugin.junit</groupId>
<artifactId>x4o-plugin-maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>x4o-plugin-maven-test</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>x4o-plugin-maven</artifactId>
<configuration>
<outputDirectory>target/jtest/write-language-doc</outputDirectory>
<languages>
<cel>ALL</cel>
<eld>ALL</eld>
</languages>
</configuration>
</plugin>
</plugins>
</build>
</project>