diff --git a/nx01-x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java b/nx01-x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java index c248faa..6ef0ebb 100644 --- a/nx01-x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java +++ b/nx01-x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java @@ -46,7 +46,7 @@ import org.xml.sax.SAXException; */ public class EldXsdWriter { - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_ELD_XSD; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"eld-xsd/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path"; diff --git a/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java b/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java index 6eec66e..844611f 100644 --- a/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java +++ b/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java @@ -57,7 +57,7 @@ public class DefaultX4OReader extends AbstractX4OReader { private final PropertyConfig propertyConfig; - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_READER; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"reader/x4o/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String SAX_ERROR_HANDLER = PROPERTY_CONTEXT_PREFIX + "sax/error-handler"; diff --git a/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java b/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java index c94a998..9db881b 100644 --- a/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java +++ b/nx01-x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java @@ -64,7 +64,7 @@ public class DefaultX4OWriter extends AbstractX4OWriter { private final PropertyConfig propertyConfig; - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_WRITER; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"writer/x4o/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; diff --git a/nx01-x4o-driver/src/main/java/org/x4o/xml/lang/task/X4OStaticWriter.java b/nx01-x4o-driver/src/main/java/org/x4o/xml/lang/task/X4OStaticWriter.java index c13ed63..09fe75e 100644 --- a/nx01-x4o-driver/src/main/java/org/x4o/xml/lang/task/X4OStaticWriter.java +++ b/nx01-x4o-driver/src/main/java/org/x4o/xml/lang/task/X4OStaticWriter.java @@ -41,7 +41,7 @@ import org.xml.sax.SAXException; */ public class X4OStaticWriter { - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_X4O_STATIC; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"x4o-static/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path"; diff --git a/nx01-x4o-driver/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java b/nx01-x4o-driver/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java index 305bf46..c02c50b 100644 --- a/nx01-x4o-driver/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java +++ b/nx01-x4o-driver/src/test/java/org/x4o/xml/core/X4OEntityResolverTest.java @@ -86,7 +86,7 @@ public class X4OEntityResolverTest { public void testResolveProperty() throws Exception { X4ODriver driver = new TestDriver(); X4OLanguageSession language = driver.createLanguage().createLanguageSession(); - PropertyConfig conf = new PropertyConfig(DefaultX4OReader.DEFAULT_PROPERTY_CONFIG,PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_READER); + PropertyConfig conf = new PropertyConfig(DefaultX4OReader.DEFAULT_PROPERTY_CONFIG,PropertyConfig.X4O_PROPERTIES_PREFIX+"reader/x4o/"); conf.setProperty(DefaultX4OReader.SAX_ENTITY_RESOLVER, new TestEntityResolver()); X4OEntityResolver resolver = new X4OEntityResolver(language,conf); Exception e = null; @@ -104,7 +104,7 @@ public class X4OEntityResolverTest { public void testResolvePropertyNull() throws Exception { X4ODriver driver = new TestDriver(); X4OLanguageSession language = driver.createLanguage().createLanguageSession(); - PropertyConfig conf = new PropertyConfig(DefaultX4OReader.DEFAULT_PROPERTY_CONFIG,PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_READER); + PropertyConfig conf = new PropertyConfig(DefaultX4OReader.DEFAULT_PROPERTY_CONFIG,PropertyConfig.X4O_PROPERTIES_PREFIX+"reader/x4o/"); conf.setProperty(DefaultX4OReader.SAX_ENTITY_RESOLVER, new TestEntityResolver()); X4OEntityResolver resolver = new X4OEntityResolver(language,conf); Exception e = null; diff --git a/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java b/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java index 88f4818..98c31d9 100644 --- a/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java +++ b/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/EldDocWriter.java @@ -79,7 +79,7 @@ public class EldDocWriter { private static final String[] CC_CONFIGURATOR_G = {"configurator-global","ConfiguratorGlobal","The global configurator.","The global configurator."}; private static final String[] CC_BINDING = {"binding","Binding","The element binding.","The element binding."}; - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_ELD_DOC; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"eld-doc/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path"; diff --git a/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocWriter.java b/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocWriter.java index 0a7abcc..70bf60b 100644 --- a/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocWriter.java +++ b/nx01-x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocWriter.java @@ -61,8 +61,10 @@ import org.xml.sax.SAXException; * @version 1.0 Aug 26, 2010 */ public class ApiDocWriter { + + // NOTE: this class is unused, and is waiting for ApiDocProject code and replaces most code in EldDocWriter to here. - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_ELD_DOC; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"api-doc/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path"; diff --git a/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/PropertyConfig.java b/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/PropertyConfig.java index ce0e852..6a06167 100644 --- a/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/PropertyConfig.java +++ b/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/PropertyConfig.java @@ -38,23 +38,11 @@ import java.util.function.Supplier; */ public final class PropertyConfig implements Cloneable { + public final static String X4O_PROPERTIES_PREFIX = "http://x4o.org/properties/"; private final Map items; private final boolean readOnly; private final String keyPrefix; - // TODO: move to ? -// public final static String X4O_PROPERTIES_PREFIX = "http://language.x4o.org/xml/properties/"; - public final static String X4O_PROPERTIES_PREFIX = "http://x4o.org/properties/"; - public final static String X4O_PROPERTIES_READER = "reader/x4o/"; - //public final static String X4O_PROPERTIES_READER_DTD = "reader/dtd/"; - public final static String X4O_PROPERTIES_WRITER = "writer/x4o/"; - public final static String X4O_PROPERTIES_WRITER_XML = "content/"; - public final static String X4O_PROPERTIES_ELD_XSD = "eld-xsd/"; - public final static String X4O_PROPERTIES_ELD_DOC = "eld-doc/"; - public final static String X4O_PROPERTIES_X4O_STATIC = "x4o-static/"; - //public final static String X4O_PROPERTIES_WRITER_DTD = "writer/dtd/"; - //public final static String X4O_PROPERTIES_WRITER_HTML = "writer/html/"; - public PropertyConfig(String keyPrefix,PropertyConfigItem...items) { this(false,null,keyPrefix,items); } @@ -421,19 +409,19 @@ public final class PropertyConfig implements Cloneable { return; } if (Boolean.class.equals(valueType)) { - setProperty(key, new Boolean(value)); + setProperty(key, Boolean.parseBoolean(value)); return; } if (Integer.class.equals(valueType)) { - setProperty(key, new Integer(value)); + setProperty(key, Integer.parseInt(value)); return; } if (Double.class.equals(valueType)) { - setProperty(key, new Double(value)); + setProperty(key, Double.parseDouble(value)); return; } if (Float.class.equals(valueType)) { - setProperty(key, new Float(value)); + setProperty(key, Float.parseFloat(value)); return; } if (File.class.equals(valueType)) { diff --git a/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/AbstractContentWriterHandler.java b/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/AbstractContentWriterHandler.java index f7359f2..ff5638c 100644 --- a/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/AbstractContentWriterHandler.java +++ b/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/AbstractContentWriterHandler.java @@ -64,7 +64,7 @@ public class AbstractContentWriterHandler implements ContentHandler { private String lastElement = null; private Stack elements = null; - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_WRITER_XML; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"content/"; // TODO: change to "writer/xml" public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String OUTPUT_ENCODING = PROPERTY_CONTEXT_PREFIX+"output/encoding"; public final static String OUTPUT_CHAR_TAB = PROPERTY_CONTEXT_PREFIX+"output/char-tab"; diff --git a/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/xdbx/AbstractXDBXWriterHandler.java b/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/xdbx/AbstractXDBXWriterHandler.java index 716919e..307f1f9 100644 --- a/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/xdbx/AbstractXDBXWriterHandler.java +++ b/nx01-x4o-o2o/src/main/java/org/x4o/xml/o2o/io/sax3/xdbx/AbstractXDBXWriterHandler.java @@ -63,7 +63,7 @@ public class AbstractXDBXWriterHandler implements ContentHandler { private Stack elements = null; private Map stringIdx = null; - private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+PropertyConfig.X4O_PROPERTIES_WRITER_XML; + private final static String PROPERTY_CONTEXT_PREFIX = PropertyConfig.X4O_PROPERTIES_PREFIX+"writer/xdbx/"; public final static PropertyConfig DEFAULT_PROPERTY_CONFIG; public final static String OUTPUT_DECLARATION = PROPERTY_CONTEXT_PREFIX+"output/declaration"; public final static String OUTPUT_CHAR_NULL = PROPERTY_CONTEXT_PREFIX+"output/char-null"; diff --git a/nx01-x4o-o2o/src/test/java/org/x4o/xml/o2o/io/sax3/xdbx/XDBXWriterXmlTest.java b/nx01-x4o-o2o/src/test/java/org/x4o/xml/o2o/io/sax3/xdbx/XDBXWriterXmlTest.java index 121c7d3..707a7e6 100644 --- a/nx01-x4o-o2o/src/test/java/org/x4o/xml/o2o/io/sax3/xdbx/XDBXWriterXmlTest.java +++ b/nx01-x4o-o2o/src/test/java/org/x4o/xml/o2o/io/sax3/xdbx/XDBXWriterXmlTest.java @@ -29,8 +29,6 @@ import java.io.StringWriter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.x4o.xml.o2o.io.sax3.ContentWriterXml; -import org.x4o.xml.o2o.io.sax3.xdbx.XDBXReaderXml; -import org.x4o.xml.o2o.io.sax3.xdbx.XDBXWriterXml; import org.xml.sax.helpers.AttributesImpl; /** @@ -155,9 +153,9 @@ public class XDBXWriterXmlTest { writer.startElement("", "name", "", atts); writer.characters("Bill"); writer.endElement("", "name", ""); - writer.startElement("bar", "age", "foo:age", new AttributesImpl()); + writer.startElement("bar", "age", "age", new AttributesImpl()); writer.characters("35"); - writer.endElement("", "age", ""); + writer.endElement("bar", "age", "age"); writer.endElement("", "Person", ""); writer.startElement("", "Person", "", new AttributesImpl()); @@ -166,9 +164,9 @@ public class XDBXWriterXmlTest { writer.startElement("", "name", "", atts); writer.characters("Joe"); writer.endElement("", "name", ""); - writer.startElement("bar", "age", "foo:age", new AttributesImpl()); + writer.startElement("bar", "age", "age", new AttributesImpl()); writer.characters("45"); - writer.endElement("", "age", ""); + writer.endElement("bar", "age", "age"); writer.endElement("", "Person", ""); writer.endElement("", "root", "");