diff --git a/license.txt b/licence.txt
similarity index 100%
rename from license.txt
rename to licence.txt
diff --git a/pom.xml b/pom.xml
index c3fc93d..8ec5366 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,6 +2,11 @@
4.0.0
+
+ love.distributedrebirth.jedi
+ parent-jedi-pom
+ 〇一。壬寅。一〄-SNAPSHOT
+
org.x4o
x4o
pom
@@ -14,38 +19,6 @@
X4O
http://www.x4o.org/
-
-
- willem.cazander
- Willem Cazander
- w.cazander@gmail.com
- X4O.org
- +1
-
- Project Manager
- Architect
-
-
-
-
-
- BSD
- license.txt
- repo
-
-
-
- scm:git:ssh://git.sv.gnu.org:/srv/git/x4o.git
- scm:git:ssh://git.sv.gnu.org:/srv/git/x4o.git
- http://git.savannah.gnu.org/cgit/x4o.git
-
-
- savannah
- https://savannah.nongnu.org/bugs/?group=x4o
-
-
- 3.0.1
-
x4o-driver
x4o-eld-doc
@@ -53,17 +26,9 @@
x4o-meta
x4o-tool
-
-
- x4o-site
- http://www.x4o.org/
-
-
- UTF-8
- 1.5
-
+
1.0-beta-1
@@ -112,235 +78,55 @@
3.0.1
3.2
-
-
-
- maven-clean-plugin
- ${maven-clean-plugin.version}
-
-
- default-clean
- clean
-
- clean
-
-
-
- true
-
-
- ${project.build.directory}
-
- **/*
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven-compiler-plugin.version}
-
- ${project.build.sourceEncoding}
-
- ${project.build.javaVersion}
- true
- true
- true
- false
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- ${maven-source-plugin.version}
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- ${maven-javadoc-plugin.version}
-
- true
-
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven-surefire-plugin.version}
-
-
- **/*Test.java
-
-
- **/*InteractiveTest.java
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${maven-checkstyle-plugin.version}
-
- true
- src/main/config/checkstyle.xml
-
-
-
- org.apache.maven.plugins
- maven-site-plugin
- ${maven-site-plugin.version}
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-release-plugin
- ${maven-release-plugin.version}
-
- clean install verify
- clean install
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-project-info-reports-plugin
- ${maven-project-info-reports-plugin.version}
-
- true
- false
- false
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- ${maven-javadoc-plugin.version}
-
- true
- true
- true
- 64m
- 512m
- true
- true
-
-
-
-
- aggregate
- test-aggregate
- fix
- test-fix
-
-
-
-
-
- org.codehaus.mojo
- cobertura-maven-plugin
- ${cobertura-maven-plugin.version}
-
- true
-
- html
- xml
-
-
-
-
- org.codehaus.mojo
- jdepend-maven-plugin
- ${jdepend-maven-plugin.version}
-
-
- org.apache.maven.plugins
- maven-pmd-plugin
- ${maven-pmd-plugin.version}
-
- true
- true
- ${project.build.sourceEncoding}
- 100
- ${project.build.javaVersion}
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${maven-checkstyle-plugin.version}
-
- true
- true
- src/main/config/checkstyle.xml
-
-
-
- org.apache.maven.plugins
- maven-surefire-report-plugin
- ${maven-surefire-report-plugin.version}
-
- true
-
-
-
- org.apache.maven.plugins
- maven-changelog-plugin
- ${maven-changelog-plugin.version}
- false
-
-
-
+
+
+
+ org.junit.jupiter
+ junit-jupiter
+ 5.11.0-M1
+
+
+ org.apache.tomcat
+ jasper-el
+ 6.0.53
+
+
+ de.odysseus.juel
+ juel
+ 2.1.0
+
+
+ org.x4o
+ x4o-driver
+ ${project.version}
+
+
+ org.x4o
+ x4o-eld-doc
+ ${project.version}
+
+
+ org.x4o
+ x4o-html
+ ${project.version}
+
+
+ org.x4o
+ x4o-meta
+ ${project.version}
+
+
+ org.x4o
+ x4o-tool-ant-plugin
+ ${project.version}
+
+
+ org.x4o
+ x4o-tool-maven-plugin
+ ${project.version}
+
+
+
x4o-test-none
@@ -367,106 +153,5 @@
true
-
- x4o-build-site-doc
-
- true
-
-
-
- x4o-check-license
-
- true
-
-
-
-
- com.mycila.maven-license-plugin
- maven-license-plugin
- ${maven-license-plugin.version}
-
-
- true
- true
- false
- true
-
- **/*~
- **/.git
- **/.git/**
- .gitignore
- **/target/**
- **/test-output/**
- **/release.properties
- **/dependency-reduced-pom.xml
- **/.classpath
- **/.project
- **/.settings/**
- **/*.txt
- **/*.jks
- **/*.sch
- **/*.so
- **/*.dll
- **/*.png
- **/*.pom
- **/.empty
- **/.directory
- **/empty-real.xml
- **/empty-test.xml
- **/empty-x4o.xml
- **/empty-xml.xml
- **/src/main/resources/org/x4o/html/spec/html-3.2/HTML32.dcl
- **/src/main/resources/org/x4o/html/spec/html-3.2/HTML32.dtd
- **/src/main/resources/org/x4o/html/spec/html-3.2/ISOlat1.ent
- **/src/main/resources/org/x4o/html/spec/html-3.2/html32.soc
- **/src/main/resources/org/x4o/html/spec/html-4.01/HTML4.cat
- **/src/main/resources/org/x4o/html/spec/html-4.01/HTML4.decl
- **/src/main/resources/org/x4o/html/spec/html-4.01/HTMLlat1.ent
- **/src/main/resources/org/x4o/html/spec/html-4.01/HTMLspecial.ent
- **/src/main/resources/org/x4o/html/spec/html-4.01/HTMLsymbol.ent
- **/src/main/resources/org/x4o/html/spec/html-4.01/frameset.dtd
- **/src/main/resources/org/x4o/html/spec/html-4.01/loose.dtd
- **/src/main/resources/org/x4o/html/spec/html-4.01/strict.dtd
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml-lat1.ent
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml-special.ent
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml-symbol.ent
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml.soc
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml1-frameset.dtd
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml1-strict.dtd
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml1-transitional.dtd
- **/src/main/resources/org/x4o/html/spec/xhtml-1.0/xhtml1.dcl
- **/src/main/resources/org/x4o/html/spec/html-5.draft/html5dtd.org-draft.dtd
- **/src/main/resources/org/x4o/html/spec/html-5.draft/entities.json
-
-
- SLASHSTAR_STYLE
- XML_STYLE
- XML_STYLE
- XML_STYLE
- XML_STYLE
- XML_STYLE
- XML_STYLE
- DOUBLETILDE_STYLE
- SCRIPT_STYLE
- SCRIPT_STYLE
- SLASHSTAR_STYLE
- DOUBLEDASHES_STYLE
- DOUBLEDASHES_STYLE
- XML_STYLE
- XML_STYLE
-
-
-
-
- test
-
- check
-
-
-
-
-
-
-
diff --git a/x4o-driver/pom.xml b/x4o-driver/pom.xml
index e326099..2f8e9b3 100644
--- a/x4o-driver/pom.xml
+++ b/x4o-driver/pom.xml
@@ -14,45 +14,18 @@
org.apache.tomcat
jasper-el
- ${jasper-el.version}
- de.odysseus.juel
- juel
- ${juel.version}
- test
-
-
- junit
- junit
- ${junit.version}
- test
-
-
- xerces
- xercesImpl
- ${xerces.version}
+ org.junit.jupiter
+ junit-jupiter
test
-
-
-
- org.apache.maven.plugins
- maven-site-plugin
- ${maven-site-plugin.version}
-
- ${project.basedir}/../src/site-child
-
-
-
-
org.apache.maven.plugins
maven-jar-plugin
- ${maven-jar-plugin.version}
diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementRefectionBindingHandler.java b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementRefectionBindingHandler.java
index cff864d..bb25577 100644
--- a/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementRefectionBindingHandler.java
+++ b/x4o-driver/src/main/java/org/x4o/xml/eld/lang/ElementRefectionBindingHandler.java
@@ -23,12 +23,14 @@
package org.x4o.xml.eld.lang;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.x4o.xml.element.AbstractElementBindingHandler;
import org.x4o.xml.element.Element;
import org.x4o.xml.element.ElementBindingHandlerException;
+import org.x4o.xml.element.ElementObjectPropertyValueException;
/**
* Binds to objects together with a method found by reflection.
@@ -40,6 +42,7 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
private Class> parentClass = null;
private Class> childClass = null;
+ private String property = null;
private String addMethod = null;
private String getMethod = null;
private String skipChilderenClassRegex = null;
@@ -61,10 +64,37 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
/**
* @see org.x4o.xml.element.AbstractElementBindingHandler#bindChild(org.x4o.xml.element.Element, java.lang.Object, java.lang.Object)
*/
+ @SuppressWarnings(value = {"unchecked", "rawtypes"})
public void bindChild(Element childElement, Object parentObject, Object childObject) throws ElementBindingHandlerException {
- if (parentClass==null | childClass==null | addMethod==null) {
+ if (parentClass==null | childClass==null) {
throw new IllegalStateException("Missing property: parentClass="+parentClass+" childClass="+childClass+" addMethod="+addMethod+".");
}
+ if (property != null) { // Tmp hanky code here...
+ try {
+ String pop = property.substring(0,1).toUpperCase() + property.substring(1);
+ Method propType = parentObject.getClass().getMethod("get" + pop);
+ if (List.class.isAssignableFrom(propType.getReturnType())) {
+ Object data = childElement.getLanguageSession().getElementObjectPropertyValue().getProperty(parentObject, property);
+ if (data == null) {
+ // TODO: redo wrong type, add accesser object return from ElementObjectPropertyValue !!
+ childElement.getLanguageSession().getElementObjectPropertyValue().setProperty(parentObject, property, new ArrayList<>());
+ data = childElement.getLanguageSession().getElementObjectPropertyValue().getProperty(parentObject, property);
+ }
+ if (data instanceof Collection) {
+ Collection dataCollection = (Collection)data;
+ dataCollection.add(childObject);
+ return;
+ }
+ throw new ElementBindingHandlerException("Unhandled property collection type: "+data.getClass()+" on: "+parentObject.getClass()+" id:"+getId());
+ }
+
+ childElement.getLanguageSession().getElementObjectPropertyValue().setProperty(parentObject, property, childObject);
+ return;
+ } catch (/*ElementObjectPropertyValueException |*/ Exception e) {
+ throw new ElementBindingHandlerException(getId() + " error " + e.getMessage(), e);
+ }
+ }
+ // TODO: remove old...
Method[] ms = parentObject.getClass().getMethods();
for (Method m:ms) {
Class>[] types = m.getParameterTypes();
@@ -86,17 +116,26 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
return;
}
}
- throw new ElementBindingHandlerException("Could not find method: "+addMethod+" on: "+childClass+" id:"+getId());
+ throw new ElementBindingHandlerException("Could not find method: "+addMethod+" on: "+parentObject.getClass()+" 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) {
+ if (parentClass==null | childClass==null) {
throw new IllegalStateException("Missing property: parentClass="+parentClass+" childClass="+childClass+" getMethod="+getMethod+".");
}
+ if (property != null) {
+ try {
+ Object data = parentElement.getLanguageSession().getElementObjectPropertyValue().getProperty(parentObject, property);
+ createSafeChildLoop(parentElement, data);
+ } catch (ElementObjectPropertyValueException e) {
+ throw new ElementBindingHandlerException(e.getMessage(), e);
+ }
+ return;
+ }
Method[] ms = parentObject.getClass().getMethods();
for (Method m:ms) {
Class>[] types = m.getParameterTypes();
@@ -112,32 +151,38 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
} catch (Exception e) {
throw new ElementBindingHandlerException("Invoke error: "+e.getMessage()+" from: "+getMethod+" on: "+parentObject+" id:"+getId(),e);
}
- if (result==null) {
- return; // null is no childeren
- }
- if (result instanceof List) {
- for (Object o:(List)result) {
- createSafeChild(parentElement, o);
- }
- return;
- } else if (result instanceof Collection) {
- for (Object o:(Collection)result) {
- createSafeChild(parentElement, o);
- }
- return;
- } else if (result.getClass().isArray()) {
- for (Object o:(Object[])result) {
- createSafeChild(parentElement, o);
- }
- return;
- } else if (childClass.isAssignableFrom(result.getClass())) {
- createSafeChild(parentElement, result);
- return;
- } else {
- throw new ElementBindingHandlerException("Unsupported return type: "+result.getClass()+" need: "+childClass+" from: "+getMethod+" on: "+parentObject+" id:"+getId());
- }
+ createSafeChildLoop(parentElement, result);
+ return;
+ }
+ throw new ElementBindingHandlerException("Could not find method: "+getMethod+" on: "+parentObject.getClass()+" id:"+getId());
+ }
+
+ @SuppressWarnings("rawtypes")
+ protected void createSafeChildLoop(Element parentElement,Object result) throws ElementBindingHandlerException {
+ if (result==null) {
+ return; // null is no childeren
+ }
+ if (result instanceof List) {
+ for (Object o:(List)result) {
+ createSafeChild(parentElement, o);
+ }
+ return;
+ } else if (result instanceof Collection) {
+ for (Object o:(Collection)result) {
+ createSafeChild(parentElement, o);
+ }
+ return;
+ } else if (result.getClass().isArray()) {
+ for (Object o:(Object[])result) {
+ createSafeChild(parentElement, o);
+ }
+ return;
+ } else if (childClass.isAssignableFrom(result.getClass())) {
+ createSafeChild(parentElement, result);
+ return;
+ } else {
+ throw new ElementBindingHandlerException("Unsupported return type: "+result.getClass()+" need: "+childClass+" from: "+getMethod+" on: "+parentElement.getElementObject().getClass()+" id:"+getId());
}
- throw new ElementBindingHandlerException("Could not find method: "+getMethod+" on: "+parentObject+" id:"+getId());
}
/**
@@ -211,6 +256,20 @@ public class ElementRefectionBindingHandler extends AbstractElementBindingHandle
this.getMethod = getMethod;
}
+ /**
+ * @return the property
+ */
+ public String getProperty() {
+ return property;
+ }
+
+ /**
+ * @param property the property to set
+ */
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
/**
* @return the skipChilderenClassRegex
*/
diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java b/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java
index c2c30a5..df9ff3c 100644
--- a/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java
+++ b/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriter.java
@@ -53,9 +53,15 @@ public class EldXsdWriter {
public final static String OUTPUT_DOCUMENTATION = PROPERTY_CONTEXT_PREFIX+"output/documentation";
public final static String FILTER_NAMESPACE = PROPERTY_CONTEXT_PREFIX+"filter/namespace";
public final static String FILTER_ELEMENT = PROPERTY_CONTEXT_PREFIX+"filter/element";
+ public final static String PROLOG_SEPERATOR_LINE = PROPERTY_CONTEXT_PREFIX+"prolog/seperator-line";
+ public final static String PROLOG_SEPERATOR_ENABLE = PROPERTY_CONTEXT_PREFIX+"prolog/seperator-enable";
+ public final static String PROLOG_GENERATED_VERSION = PROPERTY_CONTEXT_PREFIX+"prolog/generated-version";
public final static String PROLOG_GENERATED_BY = PROPERTY_CONTEXT_PREFIX+"prolog/generated-by";
- public final static String PROLOG_GENERATED_BY_ENABLE = PROPERTY_CONTEXT_PREFIX+"prolog/generated-by-enable";
- public final static String PROLOG_PROVIDER_INFO_ENABLE = PROPERTY_CONTEXT_PREFIX+"prolog/provider-info-enable";
+ public final static String PROLOG_GENERATED_ENABLE = PROPERTY_CONTEXT_PREFIX+"prolog/generated-enable";
+ public final static String PROLOG_XMLNS_INFO_ENABLE = PROPERTY_CONTEXT_PREFIX+"prolog/xmlns-info-enable";
+ public final static String PROLOG_XMLNS_DESC_ENABLE = PROPERTY_CONTEXT_PREFIX+"prolog/xmlns-desc-enable";
+
+ private static final String DEFAULT_PROLOG_SEPERATOR = " ===================================================================== ";
static {
DEFAULT_PROPERTY_CONFIG = new PropertyConfig(true,ContentWriterXml.DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX,
@@ -63,9 +69,13 @@ public class EldXsdWriter {
new PropertyConfigItem(OUTPUT_DOCUMENTATION, Boolean.class, true),
new PropertyConfigItem(FILTER_NAMESPACE, String.class ),
new PropertyConfigItem(FILTER_ELEMENT, String.class ),
+ new PropertyConfigItem(PROLOG_SEPERATOR_LINE, String.class, DEFAULT_PROLOG_SEPERATOR),
+ new PropertyConfigItem(PROLOG_SEPERATOR_ENABLE, Boolean.class, true),
+ new PropertyConfigItem(PROLOG_GENERATED_VERSION, String.class ),
new PropertyConfigItem(PROLOG_GENERATED_BY, String.class ),
- new PropertyConfigItem(PROLOG_GENERATED_BY_ENABLE, Boolean.class, true),
- new PropertyConfigItem(PROLOG_PROVIDER_INFO_ENABLE, Boolean.class, true)
+ new PropertyConfigItem(PROLOG_GENERATED_ENABLE, Boolean.class, true),
+ new PropertyConfigItem(PROLOG_XMLNS_INFO_ENABLE, Boolean.class, true),
+ new PropertyConfigItem(PROLOG_XMLNS_DESC_ENABLE, Boolean.class, true)
);
}
diff --git a/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriterElement.java b/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriterElement.java
index 8129ce8..6c13e76 100644
--- a/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriterElement.java
+++ b/x4o-driver/src/main/java/org/x4o/xml/eld/xsd/EldXsdWriterElement.java
@@ -40,6 +40,7 @@ import org.x4o.xml.element.ElementMetaBase;
import org.x4o.xml.element.ElementNamespace;
import org.x4o.xml.element.ElementNamespaceAttribute;
import org.x4o.xml.io.XMLConstants;
+import org.x4o.xml.io.sax.ext.ContentWriterXml;
import org.x4o.xml.io.sax.ext.ContentWriterXsd;
import org.x4o.xml.io.sax.ext.ContentWriterXsd.Tag;
import org.x4o.xml.io.sax.ext.PropertyConfig;
@@ -144,62 +145,63 @@ public class EldXsdWriterElement {
}
}
- private static final String COMMENT_SEPERATOR = " ==================================================================== ";
- private static final String COMMENT_TEXT = "=====";
+
+ private static final String COMMENT_FORMAT = "%1$-20s %2$s";
private void prologWriteGenerator() throws SAXException {
- if (!propertyConfig.getPropertyBoolean(EldXsdWriter.PROLOG_GENERATED_BY_ENABLE)) {
+ if (propertyConfig.getPropertyBoolean(EldXsdWriter.PROLOG_SEPERATOR_ENABLE)) {
+ xsdWriter.printComment(propertyConfig.getPropertyString(EldXsdWriter.PROLOG_SEPERATOR_LINE));
+ }
+ if (!propertyConfig.getPropertyBoolean(EldXsdWriter.PROLOG_GENERATED_ENABLE)) {
return;
}
- //xsdWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
- xsdWriter.printComment(COMMENT_SEPERATOR);
-
- String byValue = propertyConfig.getPropertyString(EldXsdWriter.PROLOG_GENERATED_BY, EldXsdWriter.class.getSimpleName());
- if (!byValue.endsWith(".")) {
- byValue += '.';
+ String chEnter = propertyConfig.getPropertyString(ContentWriterXml.OUTPUT_CHAR_NEWLINE);
+ String chTab = propertyConfig.getPropertyString(ContentWriterXml.OUTPUT_CHAR_TAB);
+ String generatedBy = propertyConfig.getPropertyString(EldXsdWriter.PROLOG_GENERATED_BY, EldXsdWriter.class.getSimpleName());
+ String generatedVersion = propertyConfig.getPropertyString(EldXsdWriter.PROLOG_GENERATED_VERSION);
+ StringBuilder b = new StringBuilder();
+ b.append(chEnter + chTab + String.format(COMMENT_FORMAT,"GeneratedBy:",generatedBy));
+ b.append(chEnter + chTab + String.format(COMMENT_FORMAT,"GeneratedDate:",new Date()));
+ if (generatedVersion != null && !generatedVersion.isEmpty()) {
+ b.append(chEnter + chTab + String.format(COMMENT_FORMAT,"GeneratedVersion:",generatedVersion));
}
-
- // this is a mess;
- String desc = "Automatic generated schema for language: "+language.getLanguageName()+" by "+byValue;
- int space = COMMENT_SEPERATOR.length()-desc.length()-(2*COMMENT_TEXT.length())-4;
- StringBuilder b = new StringBuilder(COMMENT_SEPERATOR.length());
- b.append(" ");
- b.append(COMMENT_TEXT);
- b.append(" ");
- b.append(desc);
- for (int i=0;i attrNames = new ArrayList(30);
diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/XMLConstants.java b/x4o-driver/src/main/java/org/x4o/xml/io/XMLConstants.java
index 295e254..2f655d0 100644
--- a/x4o-driver/src/main/java/org/x4o/xml/io/XMLConstants.java
+++ b/x4o-driver/src/main/java/org/x4o/xml/io/XMLConstants.java
@@ -22,6 +22,8 @@
*/
package org.x4o.xml.io;
+import java.util.PrimitiveIterator;
+
/**
* XMLConstants for writing XML.
*
@@ -72,9 +74,9 @@ public final class XMLConstants {
public static final String NULL_NS_URI = javax.xml.XMLConstants.NULL_NS_URI; // ""
/**
- * (Start) Definition of DTD doctype.
+ * Definition of DTD doctype opening tag.
*/
- public static final String XML_DOCTYPE = "') {
+ if (codePoint == '>') {
result.append(">");
return true;
}
- if (c=='&') {
+ if (codePoint == '&') {
result.append("&");
return true;
}
- if (c=='\"') {
+ if (codePoint == '\"') {
result.append(""e;");
return true;
}
- if (c=='\'') {
+ if (codePoint == '\'') {
result.append("'");
return true;
}
return false;
}
- static public String escapeAttributeName(String value) {
- // Attribute ::= Name Eq AttValue
- int length = value.length();
- StringBuilder result = new StringBuilder(length);
- for (int i=0;i0) {
- if (charEntityAllowed(entity)) {
- result.append(entity);
- continue; // contine to next i char.
- } else {
- i = iOrg; // continue normal escape.
+ StringBuilder result = new StringBuilder(value.length());
+ PrimitiveIterator.OfInt iterator = value.codePoints().iterator();
+ while (iterator.hasNext()) {
+ int c = iterator.nextInt();
+ //for (int i=0;i getPropertyType(String key,Supplier> defaultValue) {
+ Class> result = getPropertyType(key);
+ if (result != null) {
+ return result;
+ }
+ return defaultValue.get();
+ }
+
public final File getPropertyFile(String key) {
Object value = getProperty(key);
if (value instanceof File) {
@@ -278,6 +288,14 @@ public final class PropertyConfig implements Cloneable {
throw new IllegalStateException("Wrong value type: "+value.getClass()+" for key: "+key);
}
+ public final File getPropertyFile(String key,Supplier defaultValue) {
+ File result = getPropertyFile(key);
+ if (result != null) {
+ return result;
+ }
+ return defaultValue.get();
+ }
+
public final Boolean getPropertyBoolean(String key) {
Object value = getProperty(key);
if (value instanceof Boolean) {
@@ -289,6 +307,14 @@ public final class PropertyConfig implements Cloneable {
throw new IllegalStateException("Wrong value type: "+value.getClass()+" for key: "+key);
}
+ public final Boolean getPropertyBoolean(String key,Supplier defaultValue) {
+ Boolean result = getPropertyBoolean(key);
+ if (result != null) {
+ return result;
+ }
+ return defaultValue.get();
+ }
+
public final Integer getPropertyInteger(String key) {
Object value = getProperty(key);
if (value instanceof Integer) {
@@ -300,6 +326,14 @@ public final class PropertyConfig implements Cloneable {
throw new IllegalStateException("Wrong value type: "+value.getClass()+" for key: "+key);
}
+ public final Integer getPropertyInteger(String key,Supplier defaultValue) {
+ Integer result = getPropertyInteger(key);
+ if (result != null) {
+ return result;
+ }
+ return defaultValue.get();
+ }
+
@SuppressWarnings("unchecked")
public final List getPropertyList(String key) {
Object value = getProperty(key);
@@ -312,6 +346,14 @@ public final class PropertyConfig implements Cloneable {
throw new IllegalStateException("Wrong value type: "+value.getClass()+" for key: "+key);
}
+ public final List getPropertyList(String key, Supplier> defaultValue) {
+ List result = getPropertyList(key);
+ if (result != null) {
+ return result;
+ }
+ return defaultValue.get();
+ }
+
@SuppressWarnings("unchecked")
public final Map getPropertyMap(String key) {
Object value = getProperty(key);
@@ -324,6 +366,14 @@ public final class PropertyConfig implements Cloneable {
throw new IllegalStateException("Wrong value type: "+value.getClass()+" for key: "+key);
}
+ public final Map getPropertyMap(String key, Supplier
-
-
-
-
- org.eclipse.m2e
- lifecycle-mapping
- 1.0.0
-
-
-
-
-
-
- org.apache.maven.plugins
-
-
- maven-plugin-plugin
-
- [3.2,)
-
- descriptor
- helpmojo
-
-
-
-
-
-
-
-
-
-
-
-