poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1881834 [2/7] - in /xmlbeans/trunk: ./ src/main/java/org/apache/xmlbeans/ src/main/java/org/apache/xmlbeans/impl/config/ src/main/java/org/apache/xmlbeans/impl/schema/ src/main/java/org/apache/xmlbeans/impl/tool/ src/main/java/org/apache/x...
Date Sat, 19 Sep 2020 02:33:17 GMT
Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java?rev=1881834&r1=1881833&r2=1881834&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java Sat
Sep 19 02:33:16 2020
@@ -32,19 +32,19 @@ public class BindingConfigImpl extends B
     private final Map _prefixMap = new LinkedHashMap();
     private final Map _suffixMap = new LinkedHashMap();
     // uri prefix -> package
-    private final Map<Object,String> _packageMapByUriPrefix = new LinkedHashMap<>();
+    private final Map<Object, String> _packageMapByUriPrefix = new LinkedHashMap<>();
     // uri prefix -> name prefix
-    private final Map<Object,String> _prefixMapByUriPrefix = new LinkedHashMap<>();
+    private final Map<Object, String> _prefixMapByUriPrefix = new LinkedHashMap<>();
     // uri prefix -> name suffix
-    private final Map<Object,String> _suffixMapByUriPrefix = new LinkedHashMap<>();
-    private final Map<QName,String> _qnameTypeMap = new LinkedHashMap<>();
-    private final Map<QName,String> _qnameDocTypeMap = new LinkedHashMap<>();
-    private final Map<QName,String> _qnameElemMap = new LinkedHashMap<>();
-    private final Map<QName,String> _qnameAttMap = new LinkedHashMap<>();
+    private final Map<Object, String> _suffixMapByUriPrefix = new LinkedHashMap<>();
+    private final Map<QName, String> _qnameTypeMap = new LinkedHashMap<>();
+    private final Map<QName, String> _qnameDocTypeMap = new LinkedHashMap<>();
+    private final Map<QName, String> _qnameElemMap = new LinkedHashMap<>();
+    private final Map<QName, String> _qnameAttMap = new LinkedHashMap<>();
 
     private final List<InterfaceExtensionImpl> _interfaceExtensions = new ArrayList<>();
     private final List<PrePostExtensionImpl> _prePostExtensions = new ArrayList<>();
-    private final Map<QName,UserTypeImpl> _userTypes = new LinkedHashMap<>();
+    private final Map<QName, UserTypeImpl> _userTypes = new LinkedHashMap<>();
 
     public static BindingConfig forConfigDocuments(Config[] configs, File[] javaFiles, File[]
classpath) {
         return new BindingConfigImpl(configs, javaFiles, classpath);
@@ -69,7 +69,7 @@ public class BindingConfigImpl extends B
                 String javaname = qnameconfig.getJavaname();
                 for (Object o : applyto) {
                     Qnametargetenum a = (Qnametargetenum) o;
-                    switch (a.enumValue().intValue()) {
+                    switch (a.getEnumValue().intValue()) {
                         case Qnametargetenum.INT_TYPE:
                             _qnameTypeMap.put(name, javaname);
                             break;
@@ -102,7 +102,7 @@ public class BindingConfigImpl extends B
     }
 
     void addInterfaceExtension(InterfaceExtensionImpl ext) {
-        if (ext==null) {
+        if (ext == null) {
             return;
         }
 
@@ -110,7 +110,7 @@ public class BindingConfigImpl extends B
     }
 
     void addPrePostExtension(PrePostExtensionImpl ext) {
-        if (ext==null) {
+        if (ext == null) {
             return;
         }
 
@@ -119,7 +119,7 @@ public class BindingConfigImpl extends B
 
     void secondPhaseValidation() {
         // validate interface methods collisions
-        Map<InterfaceExtension.MethodSignature,InterfaceExtension.MethodSignature>
methodSignatures = new HashMap<>();
+        Map<InterfaceExtension.MethodSignature, InterfaceExtension.MethodSignature>
methodSignatures = new HashMap<>();
 
         for (InterfaceExtensionImpl extension : _interfaceExtensions) {
 
@@ -154,7 +154,7 @@ public class BindingConfigImpl extends B
         }
     }
 
-    private static void recordNamespaceSetting(Object key, String value, Map<Object,String>
result) {
+    private static void recordNamespaceSetting(Object key, String value, Map<Object, String>
result) {
         if (value == null) {
             return;
         }
@@ -164,11 +164,11 @@ public class BindingConfigImpl extends B
             result.put(key, value);
         } else if (key instanceof List) {
             // map uris to value
-            ((List<?>)key).forEach(o -> result.put("##local".equals(o) ? "" : o,
value));
+            ((List<?>) key).forEach(o -> result.put("##local".equals(o) ? "" : o,
value));
         }
     }
 
-    private static void recordNamespacePrefixSetting(List list, String value, Map<Object,String>
result) {
+    private static void recordNamespacePrefixSetting(List list, String value, Map<Object,
String> result) {
         if (value == null) {
             return;
         }
@@ -183,10 +183,9 @@ public class BindingConfigImpl extends B
         Object key = ext.getFor();
 
 
-        if (key instanceof String && "*".equals(key))
+        if (key instanceof String && "*".equals(key)) {
             xbeanSet = NameSet.EVERYTHING;
-        else if (key instanceof List)
-        {
+        } else if (key instanceof List) {
             NameSetBuilder xbeanSetBuilder = new NameSetBuilder();
             for (Object o : (List) key) {
                 String xbeanName = (String) o;
@@ -195,11 +194,12 @@ public class BindingConfigImpl extends B
             xbeanSet = xbeanSetBuilder.toNameSet();
         }
 
-        if (xbeanSet == null)
+        if (xbeanSet == null) {
             error("Invalid value of attribute 'for' : '" + key + "'.", ext);
+        }
 
         Extensionconfig.Interface[] intfXO = ext.getInterfaceArray();
-        Extensionconfig.PrePostSet ppXO    = ext.getPrePostSet();
+        Extensionconfig.PrePostSet ppXO = ext.getPrePostSet();
 
         Parser loader = new Parser(javaFiles, classpath);
 
@@ -223,7 +223,7 @@ public class BindingConfigImpl extends B
         if (uri == null) {
             uri = "";
         }
-        String result = (String)map.get(uri);
+        String result = (String) map.get(uri);
         if (result != null) {
             return result;
         }
@@ -234,7 +234,7 @@ public class BindingConfigImpl extends B
             }
         }
 
-        return (String)map.get("##any");
+        return (String) map.get("##any");
     }
 
     private String lookupByUriPrefix(Map mapByUriPrefix, String uri) {
@@ -283,7 +283,9 @@ public class BindingConfigImpl extends B
         return lookup(_suffixMap, _suffixMapByUriPrefix, uri);
     }
 
-    /** @deprecated replaced with {@link #lookupJavanameForQName(QName, int)} */
+    /**
+     * @deprecated replaced with {@link #lookupJavanameForQName(QName, int)}
+     */
     public String lookupJavanameForQName(QName qname) {
         String result = _qnameTypeMap.get(qname);
         return result != null ? result : _qnameDocTypeMap.get(qname);
@@ -291,14 +293,14 @@ public class BindingConfigImpl extends B
 
     public String lookupJavanameForQName(QName qname, int kind) {
         switch (kind) {
-        case QNAME_TYPE:
-            return _qnameTypeMap.get(qname);
-        case QNAME_DOCUMENT_TYPE:
-            return _qnameDocTypeMap.get(qname);
-        case QNAME_ACCESSOR_ELEMENT:
-            return _qnameElemMap.get(qname);
-        case QNAME_ACCESSOR_ATTRIBUTE:
-            return _qnameAttMap.get(qname);
+            case QNAME_TYPE:
+                return _qnameTypeMap.get(qname);
+            case QNAME_DOCUMENT_TYPE:
+                return _qnameDocTypeMap.get(qname);
+            case QNAME_ACCESSOR_ELEMENT:
+                return _qnameElemMap.get(qname);
+            case QNAME_ACCESSOR_ATTRIBUTE:
+                return _qnameAttMap.get(qname);
         }
         return null;
     }

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java?rev=1881834&r1=1881833&r2=1881834&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
(original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
Sat Sep 19 02:33:16 2020
@@ -15,34 +15,19 @@
 
 package org.apache.xmlbeans.impl.schema;
 
-import org.apache.xmlbeans.SchemaAnnotation;
-import org.apache.xmlbeans.SchemaTypeSystem;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.SchemaGlobalElement;
-import org.apache.xmlbeans.SchemaGlobalAttribute;
-import org.apache.xmlbeans.SchemaModelGroup;
-import org.apache.xmlbeans.SchemaAttributeGroup;
-import org.apache.xmlbeans.SchemaIdentityConstraint;
-import org.apache.xmlbeans.SchemaParticle;
-import org.apache.xmlbeans.QNameSet;
-import org.apache.xmlbeans.SchemaAttributeModel;
-import org.apache.xmlbeans.SchemaComponent;
-import org.apache.xmlbeans.Filer;
+import org.apache.xmlbeans.*;
 import org.apache.xmlbeans.impl.common.QNameHelper;
 import org.apache.xmlbeans.impl.values.XmlIntegerImpl;
-import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
 import org.apache.xmlbeans.impl.values.XmlStringImpl;
-import org.apache.xmlbeans.impl.regex.RegularExpression;
-import org.apache.xmlbeans.impl.regex.SchemaRegularExpression;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
 
 import javax.xml.namespace.QName;
-
 import java.io.File;
 import java.io.InputStream;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
 import java.math.BigInteger;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 public class BuiltinSchemaTypeSystem extends SchemaTypeLoaderBase implements SchemaTypeSystem
 {
@@ -375,7 +360,7 @@ public class BuiltinSchemaTypeSystem ext
         return null;
     }
 
-    public SchemaIdentityConstraint.Ref findIdentityConstraintRef(QName name) 
+    public SchemaIdentityConstraint.Ref findIdentityConstraintRef(QName name)
     {
         return null;
     }
@@ -511,7 +496,7 @@ public class BuiltinSchemaTypeSystem ext
         try
         {
             XmlIntegerImpl i = new XmlIntegerImpl();
-            i.set(bigInt);
+            i.setBigIntegerValue(bigInt);
             i.setImmutable();
             return new XmlValueRef(i);
         }
@@ -528,7 +513,7 @@ public class BuiltinSchemaTypeSystem ext
         try
         {
             XmlIntegerImpl i = new XmlIntegerImpl();
-            i.set(bigInt);
+            i.setBigIntegerValue(bigInt);
             i.setImmutable();
             return new XmlValueRef(i);
         }
@@ -546,7 +531,7 @@ public class BuiltinSchemaTypeSystem ext
         try
         {
             XmlStringImpl i = new XmlStringImpl();
-            i.set(str);
+            i.setStringValue(str);
             i.setImmutable();
             return new XmlValueRef(i);
         }
@@ -995,11 +980,12 @@ public class BuiltinSchemaTypeSystem ext
         switch (btc)
         {
             case SchemaType.BTC_LANGUAGE:
-                pattern = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"; // we used to have ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*",
but s4s uses the more lenient pattern to the left. 
+                // we used to have ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*",
but s4s uses the more lenient pattern to the left.
+                pattern = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*";
                 hasPattern = true;
                 break;
             case SchemaType.BTC_NMTOKEN:
-                pattern = "\\c+"; 
+                pattern = "\\c+";
                 hasPattern = true;
                 break;
             case SchemaType.BTC_NAME:

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=1881834&r1=1881833&r2=1881834&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
(original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Sat Sep 19 02:33:16 2020
@@ -593,7 +593,7 @@ public final class SchemaTypeCodePrinter
         if (sType.getSimpleVariety() == SchemaType.LIST) {
             emit("java.util.List getListValue();");
             emit("java.util.List xgetListValue();");
-            emit("void setListValue(java.util.List list);");
+            emit("void setListValue(java.util.List<?> list);");
         }
     }
 
@@ -660,8 +660,8 @@ public final class SchemaTypeCodePrinter
 
         if (!hasBase) {
             emit("");
-            emit("org.apache.xmlbeans.StringEnumAbstractBase enumValue();");
-            emit("void set(org.apache.xmlbeans.StringEnumAbstractBase e);");
+            emit("org.apache.xmlbeans.StringEnumAbstractBase getEnumValue();");
+            emit("void setEnumValue(org.apache.xmlbeans.StringEnumAbstractBase e);");
         }
 
         emit("");



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message