You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2017/12/23 17:10:23 UTC
[1/4] juneau git commit: (JUNEAU-76) Improvements to Context/Builder
APIs
Repository: juneau
Updated Branches:
refs/heads/master e2b108f2e -> b49b91926
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializerBuilder.java
index 2f1223b..291f56b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializerBuilder.java
@@ -37,7 +37,7 @@ public class YamlSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public YamlSerializerBuilder(PropertyStore2 ps) {
+ public YamlSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -631,7 +631,7 @@ public class YamlSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public YamlSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public YamlSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 8d8dd2f..62ca444 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -106,7 +106,7 @@ public class RestClient extends BeanContext {
}
RestClient(
- PropertyStore2 ps,
+ PropertyStore ps,
CloseableHttpClient httpClient,
boolean keepHttpClientOpen,
Serializer serializer,
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
index 9abfae7..c8bddb3 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
@@ -123,7 +123,7 @@ public class RestClientBuilder extends BeanContextBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public RestClientBuilder(PropertyStore2 ps) {
+ public RestClientBuilder(PropertyStore ps) {
super(ps);
}
@@ -135,7 +135,7 @@ public class RestClientBuilder extends BeanContextBuilder {
if (httpClient == null)
httpClient = createHttpClient();
- PropertyStore2 ps = psb.build();
+ PropertyStore ps = psb.build();
Serializer s =
this.serializer != null
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
index 5199186..9c9f56a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
@@ -1326,12 +1326,12 @@ public class RestConfig implements ServletConfig {
}
/**
- * Creates a new {@link PropertyStore2} object initialized with the properties defined in this config.
+ * Creates a new {@link PropertyStore} object initialized with the properties defined in this config.
*
* @return A new property store.
*/
protected PropertyStoreBuilder createPropertyStore() {
- return PropertyStore2.create().add(properties);
+ return PropertyStore.create().add(properties);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index a736681..6a23baf 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -52,7 +52,7 @@ import org.apache.juneau.utils.*;
* Contains all the configuration on a REST resource and the entry points for handling REST calls.
*
* <p>
- * See {@link PropertyStore2} for more information about context properties.
+ * See {@link PropertyStore} for more information about context properties.
*/
public final class RestContext extends Context {
@@ -150,7 +150,7 @@ public final class RestContext extends Context {
*/
@SuppressWarnings("unchecked")
public RestContext(Object resource, ServletContext servletContext, RestConfig config) throws Exception {
- super(PropertyStore2.DEFAULT);
+ super(PropertyStore.DEFAULT);
RestException _initException = null;
try {
this.resource = resource;
[3/4] juneau git commit: (JUNEAU-76) Improvements to Context/Builder
APIs
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore2.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore2.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore2.java
deleted file mode 100644
index 87e9d89..0000000
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore2.java
+++ /dev/null
@@ -1,748 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau;
-
-import static org.apache.juneau.PropertyType.*;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import org.apache.juneau.PropertyStoreBuilder.*;
-import org.apache.juneau.internal.*;
-import org.apache.juneau.json.*;
-import org.apache.juneau.serializer.*;
-
-
-/**
- * Represents an immutable collection of properties.
- *
- * <p>
- * The general idea behind a property store is to serve as a reusable configuration of an artifact (e.g. a Serializer)
- * such that the artifact can be cached and reused if the property stores are 'equal'.
- *
- * <p>
- * For example, two serializers of the same type created with the same configuration will always end up being
- * the same serializer:
- *
- * <p class='bcode'>
- * WriterSerializer s1 = JsonSerializer.<jsm>create</jsm>().pojoSwaps(MySwap.<jk>class</jk>).simple().build();
- * WriterSerializer s2 = JsonSerializer.<jsm>create</jsm>().simple().pojoSwaps(MySwap.<jk>class</jk>).build();
- * <jk>assert</jk>(s1 == s2);
- * </p>
- *
- * <p>
- * This has the effect of significantly improving performance, especially if you're creating many Serializers and
- * Parsers.
- *
- * <p>
- * Property names must have the following format...
- * <p class='bcode'>
- * <js>"{group}.{name}.{type}"</js>
- * </p>
- * ...where the parts consist of the following...
- * <ul>
- * <li><js>"{group}"</js> - The group name of the property (e.g. <js>"JsonSerializer"</js>).
- * <br>It's always going to be the simple class name of the class it's associated with.
- * <li><js>"{name}"</js> - The property name (e.g. <js>"useWhitespace"</js>).
- * <li><js>"{type}"</js> - The property data type.
- * <br>A 1 or 2 character string that identifies the data type of the property.
- * <br>Valid values are:
- * <ul>
- * <li><js>"s"<js>: <code>String</code>
- * <li><js>"b"<js>: <code>Boolean</code>
- * <li><js>"i"<js>: <code>Integer</code>
- * <li><js>"c"<js>: <code>Class</code>
- * <li><js>"o"<js>: <code>Object</code>
- * <li><js>"ss"<js>: <code>TreeSet<String></code>
- * <li><js>"si"<js>: <code>TreeSet<Integer></code>
- * <li><js>"sc"<js>: <code>TreeSet<Class></code>
- * <li><js>"ls"<js>: <code>ArrayList<String></code>
- * <li><js>"li"<js>: <code>ArrayList<Integer></code>
- * <li><js>"lc"<js>: <code>ArrayList<Class></code>
- * <li><js>"lo"<js>: <code>ArrayList<Object></code>
- * <li><js>"ms"<js>: <code>TreeMap<String,String></code>
- * <li><js>"mi"<js>: <code>TreeMap<String,Integer></code>
- * <li><js>"mc"<js>: <code>TreeMap<String,Class></code>
- * <li><js>"mo"<js>: <code>TreeMap<String,Object></code>
- * </ul>
- * </ul>
- *
- * <p>
- * For example, the {@link JsonSerializer} extends from {@link Serializer} and {@link BeanContext}, and therefore
- * is configured by properties defined in the <js>"JsonSerializer"</js>, <js>"Serializer"</js>, and <js>"BeanContext"</js>
- * groups. Since serializers and bean contexts can be relatively expensive to instantiate, we can cache and
- * reuse <code>JsonSerializer</code> instances if the property store used to instantiate them have equivalent
- * <js>"JsonSerializer"</js>, <js>"Serializer"</js>, and <js>"BeanContext"</js> groups.
- *
- * <p>
- * Set and list properties have the additional convenience 'command' names for adding and removing entries:
- * <p class='bcode'>
- * <js>"{group}.{name}.{type}/add"</js> <jc>// Add a value to the set/list.</jc>
- * <js>"{group}.{name}.{type}/remove"</js> <jc>// Remove a value from the set/list.</jc>
- * </p>
- *
- * <p>
- * Set properties are typically used in cases where the order of the value is not important.
- * A <code>TreeSet</code> is used so that the order in which you add elements does not affect the resulting order
- * of the property.
- *
- * <p>
- * List properties are typically used in cases where the order in which entries are added is important.
- * Adding to a list property will cause the new entries to be added to the BEGINNING of the list.
- * This ensures that the resulting order of the list is in most-to-least importance.
- * For example, multiple calls to <code>pojoSwaps()</code> causes new entries to be added to the beginning of the list
- * so that previous values can be 'overridden':
- * <p class='bcode'>
- * <jc>// Swap order: [MySwap2.class, MySwap1.class]</jc>
- * JsonSerializer.create().pojoSwaps(MySwap1.class).pojoSwaps(MySwap2.class).build();
- * </p>
- * <p>
- * Note that the order is different when passing multiple values into the <code>pojoSwaps()</code> method, in which
- * case the order should be first-match-wins:
- * <p class='bcode'>
- * <jc>// Swap order: [MySwap1.class, MySwap2.class]</jc>
- * JsonSerializer.create().pojoSwaps(MySwap1.class,MySwap2.class).build();
- * </p>
- *
- * <p>
- * Map properties have the additional convenience property name for adding and removing map entries:
- * <p class='bcode'>
- * <js>"{group}.{name}.{type}/add.{key}"</js> <jc>// Add a map entry (or delete if the value is null).</jc>
- * </p>
- *
- * <p>
- * Property stores are entirely immutable which means their hashcode is calculated exactly once, meaning they
- * are particularly good for use as hashmap keys.
- */
-@SuppressWarnings("unchecked")
-public final class PropertyStore2 {
-
- /**
- * A default empty property store.
- */
- public static PropertyStore2 DEFAULT = PropertyStore2.create().build();
-
- final SortedMap<String,PropertyGroup> groups;
- private final int hashCode;
-
- // Created by PropertyStoreBuilder.build()
- PropertyStore2(Map<String,PropertyGroupBuilder> propertyMaps) {
- TreeMap<String,PropertyGroup> m = new TreeMap<>();
- for (Map.Entry<String,PropertyGroupBuilder> p : propertyMaps.entrySet())
- m.put(p.getKey(), p.getValue().build());
- this.groups = Collections.unmodifiableSortedMap(m);
- this.hashCode = groups.hashCode();
- }
-
- /**
- * Creates a new empty builder for a property store.
- *
- * @return A new empty builder for a property store.
- */
- public static PropertyStoreBuilder create() {
- return new PropertyStoreBuilder();
- }
-
- /**
- * Creates a new property store builder initialized with the values in this property store.
- *
- * @return A new property store builder.
- */
- public PropertyStoreBuilder builder() {
- return new PropertyStoreBuilder(this);
- }
-
- private Property findProperty(String key) {
- String g = group(key);
- String k = key.substring(g.length()+1);
- PropertyGroup pm = groups.get(g);
-
- if (pm != null) {
- Property p = pm.get(k);
- if (p != null)
- return p;
- }
-
- String s = System.getProperty(key);
- if (s != null)
- return PropertyStoreBuilder.MutableProperty.create(k, s).build();
-
- return null;
- }
-
- /**
- * Returns the raw property value with the specified name.
- *
- * @param key The property name.
- * @return The property value, or <jk>null</jk> if it doesn't exist.
- */
- public Object getProperty(String key) {
- Property p = findProperty(key);
- return p == null ? null : p.value;
- }
-
- /**
- * Returns the property value with the specified name.
- *
- * @param key The property name.
- * @param c The class to cast or convert the value to.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public <T> T getProperty(String key, Class<T> c, T def) {
- Property p = findProperty(key);
- return p == null ? def : p.as(c);
- }
-
- /**
- * Returns the class property with the specified name.
- *
- * @param key The property name.
- * @param type The class type of the property.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public <T> Class<? extends T> getClassProperty(String key, Class<T> type, Class<? extends T> def) {
- Property p = findProperty(key);
- return p == null ? def : (Class<T>)p.as(Class.class);
- }
-
- /**
- * Returns the array property value with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value, or an empty array if it doesn't exist.
- */
- public <T> T[] getArrayProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return (T[]) (p == null ? Array.newInstance(eType, 0) : p.asArray(eType));
- }
-
- /**
- * Returns the array property value with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @param def The default value.
- * @return The property value, or an empty array if it doesn't exist.
- */
- public <T> T[] getArrayProperty(String key, Class<T> eType, T[] def) {
- Property p = findProperty(key);
- return p == null ? def : p.asArray(eType);
- }
-
- /**
- * Returns the class array property with the specified name.
- *
- * @param key The property name.
- * @return The property value, or an empty array if it doesn't exist.
- */
- public Class<?>[] getClassArrayProperty(String key) {
- Property p = findProperty(key);
- return p == null ? new Class[0] : p.as(Class[].class);
- }
-
- /**
- * Returns the class array property with the specified name.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or an empty array if it doesn't exist.
- */
- public Class<?>[] getClassArrayProperty(String key, Class<?>[] def) {
- Property p = findProperty(key);
- return p == null ? def : p.as(Class[].class);
- }
-
- /**
- * Returns the class array property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value, or an empty array if it doesn't exist.
- */
- public <T> Class<T>[] getClassArrayProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? new Class[0] : p.as(Class[].class);
- }
-
- /**
- * Returns the set property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value as an unmodifiable <code>LinkedHashSet</code>, or an empty set if it doesn't exist.
- */
- public <T> Set<T> getSetProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_SET : p.asSet(eType);
- }
-
- /**
- * Returns the class set property with the specified name.
- *
- * @param key The property name.
- * @return The property value as an unmodifiable <code>LinkedHashSet</code>, or an empty set if it doesn't exist.
- */
- public Set<Class<?>> getClassSetProperty(String key) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_SET : p.asSet(Class.class);
- }
-
- /**
- * Returns the class set property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value as an unmodifiable <code>LinkedHashSet</code>, or an empty set if it doesn't exist.
- */
- public <T> Set<Class<T>> getClassSetProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_SET : p.asSet(Class.class);
- }
-
- /**
- * Returns the list property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value as an unmodifiable <code>ArrayList</code>, or an empty list if it doesn't exist.
- */
- public <T> List<T> getListProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_LIST : p.asList(eType);
- }
-
- /**
- * Returns the class list property with the specified name.
- *
- * @param key The property name.
- * @return The property value as an unmodifiable <code>ArrayList</code>, or an empty list if it doesn't exist.
- */
- public List<Class<?>> getClassListProperty(String key) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_LIST : p.asList(Class.class);
- }
-
- /**
- * Returns the class list property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value as an unmodifiable <code>ArrayList</code>, or an empty list if it doesn't exist.
- */
- public <T> List<Class<T>> getClassListProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_LIST : p.asList(Class.class);
- }
-
- /**
- * Returns the map property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value as an unmodifiable <code>LinkedHashMap</code>, or an empty map if it doesn't exist.
- */
- public <T> Map<String,T> getMapProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_MAP : p.asMap(eType);
- }
-
- /**
- * Returns the class map property with the specified name.
- *
- * @param key The property name.
- * @return The property value as an unmodifiable <code>LinkedHashMap</code>, or an empty map if it doesn't exist.
- */
- public Map<String,Class<?>> getClassMapProperty(String key) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_MAP : p.asMap(Class.class);
- }
-
- /**
- * Returns the class map property with the specified name.
- *
- * @param key The property name.
- * @param eType The class type of the elements in the property.
- * @return The property value as an unmodifiable <code>LinkedHashMap</code>, or an empty map if it doesn't exist.
- */
- public <T> Map<String,Class<T>> getClassMapProperty(String key, Class<T> eType) {
- Property p = findProperty(key);
- return p == null ? Collections.EMPTY_MAP : p.asMap(Class.class);
- }
-
- /**
- * Returns an instance of the specified class or string property.
- *
- * @param key The property name.
- * @param type The class type of the property.
- * @param def
- * The default value if the property doesn't exist.
- * <br>Can either be an instance of <code>T</code>, or a <code>Class<? <jk>extends</jk> T></code>.
- * @return A new property instance.
- */
- public <T> T getInstanceProperty(String key, Class<T> type, Object def) {
- Property p = findProperty(key);
- if (p != null)
- return p.asInstance(type);
- if (def == null)
- return null;
- if (def instanceof Class) {
- T t = ClassUtils.newInstance(type, def);
- if (t != null)
- return t;
- }
- if (type.isInstance(def))
- return (T)def;
- throw new ConfigException("Could not instantiate property ''{0}'' as type ''{1}'' with default value ''{2}''", key, type, def);
- }
-
- /**
- * Returns the specified property as an array of instantiated objects.
- *
- * @param key The property name.
- * @param type The class type of the property.
- * @param def The default object to return if the property doesn't exist.
- * @return A new property instance.
- */
- public <T> T[] getInstanceArrayProperty(String key, Class<T> type, T[] def) {
- Property p = findProperty(key);
- return p == null ? def : p.asInstanceArray(type);
- }
-
- /**
- * Returns the keys found in the specified property group.
- *
- * <p>
- * The keys are NOT prefixed with group names.
- *
- * @param group The group name.
- * @return The set of property keys, or an empty set if the group was not found.
- */
- public Set<String> getPropertyKeys(String group) {
- if (group == null)
- return Collections.EMPTY_SET;
- PropertyGroup g = groups.get(group);
- return g == null ? Collections.EMPTY_SET : g.keySet();
- }
-
- @Override /* Object */
- public int hashCode() {
- return hashCode;
- }
-
- /**
- * Returns a hashcode of this property store using only the specified group names.
- *
- * @param groups The names of the property groups to use in the calculation.
- * @return The hashcode.
- */
- public Integer hashCode(String...groups) {
- HashCode c = new HashCode();
- for (String p : groups)
- if (p != null)
- c.add(p).add(this.groups.get(p));
- return c.get();
- }
-
- @Override /* Object */
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o instanceof PropertyStore2)
- return (this.groups.equals(((PropertyStore2)o).groups));
- return false;
- }
-
- /**
- * Compares two property stores, but only based on the specified group names.
- *
- * @param ps The property store to compare to.
- * @param groups The groups to compare.
- * @return <jk>true</jk> if the two property stores are equal in the specified groups.
- */
- public boolean equals(PropertyStore2 ps, String...groups) {
- if (this == ps)
- return true;
- for (String p : groups) {
- if (p != null) {
- PropertyGroup pg1 = this.groups.get(p), pg2 = ps.groups.get(p);
- if (pg1 == null && pg2 == null)
- continue;
- if (pg1 == null || pg2 == null)
- return false;
- if (! pg1.equals(pg2))
- return false;
- }
- }
- return true;
- }
-
- /**
- * Used for debugging.
- *
- * <p>
- * Allows property stores to be serialized to easy-to-read JSON objects.
- *
- * @param beanSession The bean session.
- * @return The property groups.
- */
- public Map<String,PropertyGroup> swap(BeanSession beanSession) {
- return groups;
- }
-
- //-------------------------------------------------------------------------------------------------------------------
- // PropertyGroup
- //-------------------------------------------------------------------------------------------------------------------
-
- static class PropertyGroup {
- final SortedMap<String,Property> properties;
- private final int hashCode;
-
- PropertyGroup(Map<String,MutableProperty> properties) {
- TreeMap<String,Property> m = new TreeMap<>();
- for (Map.Entry<String,MutableProperty> p : properties.entrySet())
- m.put(p.getKey(), p.getValue().build());
- this.properties = Collections.unmodifiableSortedMap(m);
- this.hashCode = this.properties.hashCode();
- }
-
- PropertyGroupBuilder builder() {
- return new PropertyGroupBuilder(properties);
- }
-
- Property get(String key) {
- return properties.get(key);
- }
-
- @Override /* Object */
- public int hashCode() {
- return hashCode;
- }
-
- @Override /* Object */
- public boolean equals(Object o) {
- if (o instanceof PropertyGroup)
- return properties.equals(((PropertyGroup)o).properties);
- return false;
- }
-
- Set<String> keySet() {
- return properties.keySet();
- }
-
- public Map<String,Property> swap(BeanSession beanSession) {
- return properties;
- }
- }
-
- //-------------------------------------------------------------------------------------------------------------------
- // Property
- //-------------------------------------------------------------------------------------------------------------------
-
- static class Property {
- private final String name;
- final Object value;
- private final int hashCode;
- private final PropertyType type;
-
- Property(String name, Object value, PropertyType type) {
- this.name = name;
- this.value = value;
- this.type = type;
- this.hashCode = value.hashCode();
- }
-
- MutableProperty mutable() {
- switch(type) {
- case STRING:
- case BOOLEAN:
- case INTEGER:
- case CLASS:
- case OBJECT: return new MutableSimpleProperty(name, type, value);
- case SET_STRING:
- case SET_INTEGER:
- case SET_CLASS: return new MutableSetProperty(name, type, value);
- case LIST_STRING:
- case LIST_INTEGER:
- case LIST_CLASS:
- case LIST_OBJECT: return new MutableListProperty(name, type, value);
- case MAP_STRING:
- case MAP_INTEGER:
- case MAP_CLASS:
- case MAP_OBJECT: return new MutableMapProperty(name, type, value);
- }
- throw new ConfigException("Invalid type specified: ''{0}''", type);
- }
-
- public <T> T as(Class<T> c) {
- Class<?> c2 = ClassUtils.getPrimitiveWrapper(c);
- if (c2 != null)
- c = (Class<T>)c2;
- if (c.isInstance(value))
- return (T)value;
- if (c.isArray() && value instanceof Collection)
- return (T)asArray(c.getComponentType());
- if (type == STRING) {
- T t = ClassUtils.fromString(c, value.toString());
- if (t != null)
- return t;
- }
- throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}'' on property ''{2}''", type, c, name);
- }
-
- public <T> T[] asArray(Class<T> eType) {
- if (value instanceof Collection) {
- Collection<?> l = (Collection<?>)value;
- Object t = Array.newInstance(eType, l.size());
- int i = 0;
- for (Object o : l) {
- Object o2 = null;
- if (eType.isInstance(o))
- o2 = o;
- else if (type == SET_STRING || type == LIST_STRING) {
- o2 = ClassUtils.fromString(eType, o.toString());
- if (o2 == null)
- throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
- } else {
- throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
- }
- Array.set(t, i++, o2);
- }
- return (T[])t;
- }
- throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
- }
-
- public <T> Set<T> asSet(Class<T> eType) {
- if (type == SET_STRING && eType == String.class || type == SET_INTEGER && eType == Integer.class || type == SET_CLASS && eType == Class.class) {
- return (Set<T>)value;
- } else if (type == SET_STRING) {
- Set<T> s = new LinkedHashSet<>();
- for (Object o : (Set<?>)value) {
- T t = ClassUtils.fromString(eType, o.toString());
- if (t == null)
- throw new ConfigException("Invalid property conversion ''{0}'' to ''Set<{1}>'' on property ''{2}''", type, eType, name);
- s.add(t);
- }
- return Collections.unmodifiableSet(s);
- } else {
- throw new ConfigException("Invalid property conversion ''{0}'' to ''Set<{1}>'' on property ''{2}''", type, eType, name);
- }
- }
-
- public <T> List<T> asList(Class<T> eType) {
- if (type == LIST_STRING && eType == String.class || type == LIST_INTEGER && eType == Integer.class || type == LIST_CLASS && eType == Class.class || type == LIST_OBJECT) {
- return (List<T>)value;
- } else if (type == PropertyType.LIST_STRING) {
- List<T> l = new ArrayList<>();
- for (Object o : (List<?>)value) {
- T t = ClassUtils.fromString(eType, o.toString());
- if (t == null)
- throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name);
- l.add(t);
- }
- return Collections.unmodifiableList(l);
- } else {
- throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name);
- }
- }
-
- public <T> Map<String,T> asMap(Class<T> eType) {
- if (type == MAP_STRING && eType == String.class || type == MAP_INTEGER && eType == Integer.class || type == MAP_CLASS && eType == Class.class || type == MAP_OBJECT) {
- return (Map<String,T>)value;
- } else if (type == MAP_STRING) {
- Map<String,T> m = new LinkedHashMap<>();
- for (Map.Entry<String,String> e : ((Map<String,String>)value).entrySet()) {
- T t = ClassUtils.fromString(eType, e.getValue());
- if (t == null)
- throw new ConfigException("Invalid property conversion ''{0}'' to ''Map<String,{1}>'' on property ''{2}''", type, eType, name);
- m.put(e.getKey(), t);
- }
- return Collections.unmodifiableMap(m);
- } else {
- throw new ConfigException("Invalid property conversion ''{0}'' to ''Map<String,{1}>'' on property ''{2}''", type, eType, name);
- }
- }
-
- public <T> T asInstance(Class<T> iType) {
- T t = null;
- if (type == STRING)
- t = ClassUtils.fromString(iType, value.toString());
- else if (type == OBJECT && iType.isInstance(value))
- t = (T)value;
- else if (type == CLASS)
- t = ClassUtils.newInstance(iType, value);
- if (t != null)
- return t;
- throw new ConfigException("Invalid property instantiation ''{0}'' to ''{1}'' on property ''{2}''", type, iType, name);
- }
-
- public <T> T[] asInstanceArray(Class<T> eType) {
- if (value instanceof Collection) {
- Collection<?> l = (Collection<?>)value;
- Object t = Array.newInstance(eType, l.size());
- int i = 0;
- for (Object o : l) {
- Object o2 = null;
- if (eType.isInstance(o))
- o2 = o;
- else if (type == SET_STRING || type == LIST_STRING)
- o2 = ClassUtils.fromString(eType, o.toString());
- else if (type == SET_CLASS || type == LIST_CLASS)
- o2 = ClassUtils.newInstance(eType, o);
- if (o2 == null)
- throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
- Array.set(t, i++, o2);
- }
- return (T[])t;
- }
- throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
- }
-
- @Override /* Object */
- public int hashCode() {
- return hashCode;
- }
-
- @Override /* Object */
- public boolean equals(Object o) {
- if (o instanceof Property)
- return ((Property)o).value.equals(value);
- return false;
- }
-
- public Object swap(BeanSession beanSession) {
- return value;
- }
- }
-
- //-------------------------------------------------------------------------------------------------------------------
- // Utility methods
- //-------------------------------------------------------------------------------------------------------------------
-
- private static String group(String key) {
- if (key == null || key.indexOf('.') == -1 || key.charAt(key.length()-1) == '.')
- throw new ConfigException("Invalid property name specified: ''{0}''", key);
- String g = key.substring(0, key.indexOf('.'));
- if (g.isEmpty())
- throw new ConfigException("Invalid property name specified: ''{0}''", key);
- return g;
- }
-
- @Override /* Object */
- public String toString() {
- return JsonSerializer.DEFAULT_LAX.toString(this);
- }
-}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
index 25d8c44..869c914 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
@@ -13,7 +13,7 @@
package org.apache.juneau;
import static org.apache.juneau.internal.ClassUtils.*;
-import static org.apache.juneau.PropertyStore2.*;
+import static org.apache.juneau.PropertyStore.*;
import java.lang.reflect.*;
import java.util.*;
@@ -23,13 +23,13 @@ import org.apache.juneau.internal.*;
import org.apache.juneau.json.*;
/**
- * A builder for {@link PropertyStore2} objects.
+ * A builder for {@link PropertyStore} objects.
*/
public class PropertyStoreBuilder {
// Contains a cache of all created PropertyStore objects keyed by hashcode.
// Used to minimize memory consumption by reusing identical PropertyStores.
- private static final Map<Integer,PropertyStore2> CACHE = new ConcurrentHashMap<>();
+ private static final Map<Integer,PropertyStore> CACHE = new ConcurrentHashMap<>();
// Maps property suffixes (e.g. "lc") to PropertyType (e.g. LIST_CLASS)
static final Map<String,PropertyType> SUFFIX_MAP = new ConcurrentHashMap<>();
@@ -41,10 +41,10 @@ public class PropertyStoreBuilder {
private final Map<String,PropertyGroupBuilder> groups = new ConcurrentSkipListMap<>();
// Previously-created property store.
- private volatile PropertyStore2 propertyStore;
+ private volatile PropertyStore propertyStore;
// Called by PropertyStore.builder()
- PropertyStoreBuilder(PropertyStore2 ps) {
+ PropertyStoreBuilder(PropertyStore ps) {
apply(ps);
}
@@ -52,17 +52,17 @@ public class PropertyStoreBuilder {
PropertyStoreBuilder() {}
/**
- * Creates a new {@link PropertyStore2} based on the values in this builder.
+ * Creates a new {@link PropertyStore} based on the values in this builder.
*
- * @return A new {@link PropertyStore2} based on the values in this builder.
+ * @return A new {@link PropertyStore} based on the values in this builder.
*/
- public synchronized PropertyStore2 build() {
+ public synchronized PropertyStore build() {
// Reused the last one if we haven't change this builder.
if (propertyStore == null)
- propertyStore = new PropertyStore2(groups);
+ propertyStore = new PropertyStore(groups);
- PropertyStore2 ps = CACHE.get(propertyStore.hashCode());
+ PropertyStore ps = CACHE.get(propertyStore.hashCode());
if (ps == null)
CACHE.put(propertyStore.hashCode(), propertyStore);
else if (! ps.equals(propertyStore))
@@ -79,7 +79,7 @@ public class PropertyStoreBuilder {
* @param copyFrom The property store to copy the values from.
* @return This object (for method chaining).
*/
- public synchronized PropertyStoreBuilder apply(PropertyStore2 copyFrom) {
+ public synchronized PropertyStoreBuilder apply(PropertyStore copyFrom) {
if (copyFrom != null)
for (Map.Entry<String,PropertyGroup> e : copyFrom.groups.entrySet()) {
String gName = e.getKey();
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreOld.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreOld.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreOld.java
deleted file mode 100644
index b615f5d..0000000
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreOld.java
+++ /dev/null
@@ -1,1254 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau;
-
-/**
- */
-public final class PropertyStoreOld {
-//
-// // All configuration properties in this object.
-// // Keys are property prefixes (e.g. 'BeanContext').
-// // Values are maps containing properties for that specific prefix.
-// private Map<String,PropertyMap> properties = new ConcurrentSkipListMap<>();
-//
-// // Context cache.
-// // This gets cleared every time any properties change on this object.
-// private final Map<Class<? extends Context>,Context> contexts = new ConcurrentHashMap<>();
-//
-// // Global Context cache.
-// // Property stores that are the 'same' will use the same maps from this cache.
-// // 'same' means the context properties are all the same when converted to strings.
-// private static final ConcurrentHashMap<Integer, ConcurrentHashMap<Class<? extends Context>,Context>>
-// globalContextCache = new ConcurrentHashMap<>();
-//
-// private ReadWriteLock lock = new ReentrantReadWriteLock();
-// private Lock rl = lock.readLock(), wl = lock.writeLock();
-//
-// // Classloader used to instantiate Class instances.
-// ClassLoader classLoader = ClassLoader.getSystemClassLoader();
-//
-// // Parser to use to convert JSON strings to POJOs
-// ReaderParser defaultParser;
-//
-// // Bean session for converting strings to POJOs.
-// private volatile static BeanSession beanSession;
-//
-// // Used to keep properties in alphabetical order regardless of whether
-// // they're not strings.
-// static final Comparator<Object> PROPERTY_COMPARATOR = new Comparator<Object>() {
-// @Override
-// public int compare(Object o1, Object o2) {
-// return unswap(o1).toString().compareTo(unswap(o2).toString());
-// }
-// };
-//
-// /**
-// * Create a new property store with default settings.
-// *
-// * @return A new property store with default settings.
-// */
-// public static PropertyStore create() {
-// PropertyStore f = new PropertyStore();
-// BeanContext.loadDefaults(f);
-// return f;
-// }
-//
-// PropertyStoreOld() {}
-//
-// /**
-// * Copy constructor.
-// *
-// * @param copyFrom The store to copy properties from.
-// */
-// private PropertyStoreOld(PropertyStore copyFrom) {
-// copyFrom(copyFrom);
-// }
-//
-// /**
-// * Copies the properties from the specified store into this store.
-// *
-// * <p>
-// * Properties of type set/list/collection will be appended to the existing properties if they already exist.
-// *
-// * @param ps The store to copy from.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore copyFrom(PropertyStore ps) {
-// if (ps != null) {
-// // TODO - Needs more testing.
-// for (Map.Entry<String,PropertyMap> e : ps.properties.entrySet())
-// this.properties.put(e.getKey(), new PropertyMap(this.properties.get(e.getKey()), e.getValue()));
-// this.classLoader = ps.classLoader;
-// this.defaultParser = ps.defaultParser;
-// }
-// return this;
-// }
-//
-// /**
-// * Creates a new modifiable copy of this property store.
-// *
-// * @return A new modifiable copy of this property store.
-// */
-// public PropertyStore copy() {
-// return new PropertyStore(this);
-// }
-//
-// /**
-// * Sets a configuration property value on this object.
-// *
-// * <p>
-// * A typical usage is to set or overwrite configuration values like so...
-// * <p class='bcode'>
-// * PropertyStore ps = PropertyStore.<jsm>create</jsm>();
-// * ps.setProperty(<jsf>BEAN_sortProperties</jsf>, <jk>true</jk>);
-// * </p>
-// *
-// * <p>
-// * The possible class types of the value depend on the property type:
-// * <table class='styled'>
-// * <tr>
-// * <th>Property type</th>
-// * <th>Example</th>
-// * <th>Allowed value type</th>
-// * </tr>
-// * <tr>
-// * <td>Set <l>SIMPLE</l></td>
-// * <td><js>"Foo.x"</js></td>
-// * <td>Any object type.</td>
-// * </tr>
-// * <tr>
-// * <td>Set <l>SET/LIST</l></td>
-// * <td><js>"Foo.x.set"</js></td>
-// * <td>Any collection or array of any objects, or a String containing a JSON array.</td>
-// * </tr>
-// * <tr>
-// * <td>Add/Remove <l>SET/LIST</l></td>
-// * <td><js>"Foo.x.set.add"</js></td>
-// * <td>If a collection, adds or removes the entries in the collection. Otherwise, adds/removes a single
-// * entry.</td>
-// * </tr>
-// * <tr>
-// * <td>Set <l>MAP</l></td>
-// * <td><js>"Foo.x.map"</js></td>
-// * <td>A map, or a String containing a JSON object. Entries overwrite existing map.</td>
-// * </tr>
-// * <tr>
-// * <td>Put <l>MAP</l></td>
-// * <td><js>"Foo.x.map.put"</js></td>
-// * <td>A map, or a String containing a JSON object. Entries are added to existing map.</td>
-// * </tr>
-// * </table>
-// *
-// * @param name
-// * The configuration property name.
-// * <br>If name ends with <l>.add</l>, then the specified value is added to the existing property value as an entry
-// * in a SET or LIST property.
-// * <br>If name ends with <l>.put</l>, then the specified value is added to the existing property value as a
-// * key/value pair in a MAP property.
-// * <br>If name ends with <l>.remove</l>, then the specified value is removed from the existing property property
-// * value in a SET or LIST property.
-// * @param value
-// * The new value.
-// * If <jk>null</jk>, the property value is deleted.
-// * In general, the value type can be anything.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore setProperty(String name, Object value) {
-// String prefix = prefix(name);
-//
-// if (name.endsWith(".add"))
-// return addToProperty(name.substring(0, name.lastIndexOf('.')), value);
-//
-// if (name.endsWith(".put"))
-// return putToProperty(name.substring(0, name.lastIndexOf('.')), value);
-//
-// if (name.endsWith(".remove"))
-// return removeFromProperty(name.substring(0, name.lastIndexOf('.')), value);
-//
-// wl.lock();
-// try {
-// contexts.clear();
-// if (! properties.containsKey(prefix))
-// properties.put(prefix, new PropertyMap(prefix));
-// properties.get(prefix).set(name, value);
-// } finally {
-// wl.unlock();
-// }
-// return this;
-// }
-//
-// /**
-// * Synonym for {@link #setProperty(String, Object)}.
-// *
-// * @param name
-// * The configuration property name.
-// * <br>If name ends with <l>.add</l>, then the specified value is added to the existing property value as an entry
-// * in a SET or LIST property.
-// * <br>If name ends with <l>.put</l>, then the specified value is added to the existing property value as a
-// * key/value pair in a MAP property.
-// * <br>If name ends with <l>.remove</l>, then the specified value is removed from the existing property property
-// * value in a SET or LIST property.
-// * @param value
-// * The new value.
-// * If <jk>null</jk>, the property value is deleted.
-// * In general, the value type can be anything.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore append(String name, Object value) {
-// return setProperty(name, value);
-// }
-//
-// /**
-// * Convenience method for setting multiple properties in one call.
-// *
-// * <p>
-// * This appends to any previous configuration properties set on this store.
-// *
-// * @param newProperties The new properties to set.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore setProperties(Map<String,Object> newProperties) {
-// if (newProperties == null || newProperties.isEmpty())
-// return this;
-// wl.lock();
-// try {
-// contexts.clear();
-// for (Map.Entry<String,Object> e : newProperties.entrySet()) {
-// String name = e.getKey().toString();
-// Object value = e.getValue();
-// String prefix = prefix(name);
-// if (name.endsWith(".add"))
-// addToProperty(name.substring(0, name.lastIndexOf('.')), value);
-// else if (name.endsWith(".remove"))
-// removeFromProperty(name.substring(0, name.lastIndexOf('.')), value);
-// else {
-// if (! properties.containsKey(prefix))
-// properties.put(prefix, new PropertyMap(prefix));
-// properties.get(prefix).set(name, value);
-// }
-// }
-//
-// } finally {
-// wl.unlock();
-// }
-// return this;
-// }
-//
-// /**
-// * Adds several properties to this store.
-// *
-// * @param properties The properties to add to this store.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore addProperties(Map<String,Object> properties) {
-// if (properties != null)
-// for (Map.Entry<String,Object> e : properties.entrySet())
-// setProperty(e.getKey(), e.getValue());
-// return this;
-// }
-//
-// /**
-// * Adds a value to a SET property.
-// *
-// * @param name The property name.
-// * @param value The new value to add to the SET property.
-// * @return This object (for method chaining).
-// * @throws ConfigException If property is not a SET property.
-// */
-// public PropertyStore addToProperty(String name, Object value) {
-// String prefix = prefix(name);
-// wl.lock();
-// try {
-// contexts.clear();
-// if (! properties.containsKey(prefix))
-// properties.put(prefix, new PropertyMap(prefix));
-// properties.get(prefix).addTo(name, value);
-// } finally {
-// wl.unlock();
-// }
-// return this;
-// }
-//
-// /**
-// * Adds or overwrites a value to a MAP property.
-// *
-// * @param name The property name.
-// * @param key The property value map key.
-// * @param value The property value map value.
-// * @return This object (for method chaining).
-// * @throws ConfigException If property is not a MAP property.
-// */
-// public PropertyStore putToProperty(String name, Object key, Object value) {
-// String prefix = prefix(name);
-// wl.lock();
-// try {
-// contexts.clear();
-// if (! properties.containsKey(prefix))
-// properties.put(prefix, new PropertyMap(prefix));
-// properties.get(prefix).putTo(name, key, value);
-// } finally {
-// wl.unlock();
-// }
-// return this;
-// }
-//
-// /**
-// * Adds or overwrites a value to a MAP property.
-// *
-// * @param name The property value.
-// * @param value The property value map value.
-// * @return This object (for method chaining).
-// * @throws ConfigException If property is not a MAP property.
-// */
-// public PropertyStore putToProperty(String name, Object value) {
-// String prefix = prefix(name);
-// wl.lock();
-// try {
-// contexts.clear();
-// if (! properties.containsKey(prefix))
-// properties.put(prefix, new PropertyMap(prefix));
-// properties.get(prefix).putTo(name, value);
-// } finally {
-// wl.unlock();
-// }
-// return this;
-// }
-//
-// /**
-// * Removes a value from a SET property.
-// *
-// * @param name The property name.
-// * @param value The property value in the SET property.
-// * @return This object (for method chaining).
-// * @throws ConfigException If property is not a SET property.
-// */
-// public PropertyStore removeFromProperty(String name, Object value) {
-// String prefix = prefix(name);
-// wl.lock();
-// try {
-// contexts.clear();
-// if (properties.containsKey(prefix))
-// properties.get(prefix).removeFrom(name, value);
-// } finally {
-// wl.unlock();
-// }
-// return this;
-// }
-//
-// /**
-// * Returns an instance of the specified context initialized with the properties in this store.
-// *
-// * <p>
-// * Multiple calls to this method for the same store class will return the same cached value as long as the
-// * properties on this store are not touched.
-// *
-// * <p>
-// * As soon as any properties are modified on this store, all cached entries are discarded and recreated as needed.
-// *
-// * @param c The context class to instantiate.
-// * @return The context instance.
-// */
-// @SuppressWarnings("unchecked")
-// public <T extends Context> T getContext(Class<T> c) {
-// rl.lock();
-// try {
-// try {
-// if (! contexts.containsKey(c)) {
-//
-// // Try to get it from the global cache.
-// Integer key = hashCode();
-// if (! globalContextCache.containsKey(key))
-// globalContextCache.putIfAbsent(key, new ConcurrentHashMap<Class<? extends Context>,Context>());
-// ConcurrentHashMap<Class<? extends Context>, Context> cacheForThisConfig = globalContextCache.get(key);
-//
-// if (! cacheForThisConfig.containsKey(c))
-// cacheForThisConfig.putIfAbsent(c, newInstance(c, c, this));
-// else
-// CacheInfo.add(c, true);
-//
-// contexts.put(c, cacheForThisConfig.get(c));
-// } else {
-// CacheInfo.add(c, true);
-// }
-// return (T)contexts.get(c);
-// } catch (Exception e) {
-// throw new ConfigException("Could not instantiate context class ''{0}''", className(c)).initCause(e);
-// }
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// /**
-// * Returns the configuration properties with the specified prefix.
-// *
-// * <p>
-// * For example, if <l>prefix</l> is <js>"BeanContext"</js>, then retrieves all configuration properties that are
-// * prefixed with <js>"BeanContext."</js>.
-// *
-// * @param prefix The prefix of properties to retrieve.
-// * @return The configuration properties with the specified prefix, never <jk>null</jk>.
-// */
-// public PropertyMap getPropertyMap(String prefix) {
-// rl.lock();
-// try {
-// PropertyMap m = properties.get(prefix);
-// return m == null ? new PropertyMap(prefix) : m;
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// /**
-// * Specifies the classloader to use when resolving classes from strings.
-// *
-// * <p>
-// * Can be used for resolving class names when the classes being created are in a different classloader from the
-// * Juneau code.
-// *
-// * <p>
-// * If <jk>null</jk>, the system classloader will be used to resolve classes.
-// *
-// * @param classLoader The new classloader.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore setClassLoader(ClassLoader classLoader) {
-// this.classLoader = (classLoader == null ? ClassLoader.getSystemClassLoader() : classLoader);
-// return this;
-// }
-//
-// /**
-// * Specifies the parser to use to convert Strings to POJOs.
-// *
-// * <p>
-// * If <jk>null</jk>, {@link JsonParser#DEFAULT} will be used.
-// *
-// * @param defaultParser The new defaultParser.
-// * @return This object (for method chaining).
-// */
-// public PropertyStore setDefaultParser(ReaderParser defaultParser) {
-// this.defaultParser = defaultParser == null ? JsonParser.DEFAULT : defaultParser;
-// return this;
-// }
-//
-// /**
-// * Returns a property value converted to the specified type.
-// *
-// * @param name The full name of the property (e.g. <js>"BeanContext.sortProperties"</js>)
-// * @param type The class type to convert the property value to.
-// * @param def The default value if the property is not set.
-// * @return The property value.
-// * @throws ConfigException If property has a value that cannot be converted to a boolean.
-// */
-// public <T> T getProperty(String name, Class<T> type, T def) {
-// rl.lock();
-// try {
-// PropertyMap pm = getPropertyMap(prefix(name));
-// if (pm != null)
-// return pm.get(name, type, def);
-// String s = System.getProperty(name);
-// if ((! isEmpty(s)) && isBeanSessionAvailable())
-// return getBeanSession().convertToType(s, type);
-// return def;
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// /**
-// * Returns a property value either cast to the specified type, or a new instance of the specified type.
-// *
-// * <p>
-// * It's assumed that the current property value is either an instance of that type, or a <code>Class</code> that's
-// * a subclass of the type to be instantiated.
-// *
-// * @param name The full name of the property (e.g. <js>"BeanContext.sortProperties"</js>)
-// * @param type The class type to convert the property value to.
-// * @param def The type to instantiate if the property is not set.
-// * @param args The arguments to pass to the default type constructor.
-// * @return The property either cast to the specified type, or instantiated from a <code>Class</code> object.
-// * @throws ConfigException If property has a value that cannot be converted to a boolean.
-// */
-// @SuppressWarnings("unchecked")
-// public <T> T getTypedProperty(String name, Class<T> type, Class<? extends T> def, Object...args) {
-// rl.lock();
-// try {
-// Object o = null;
-// PropertyMap pm = getPropertyMap(prefix(name));
-// if (pm != null)
-// o = pm.get(name, type, null);
-// if (o == null && def != null)
-// o = getBeanSession().newInstance(type, def, args);
-// if (o == null)
-// return null;
-// if (ClassUtils.isParentClass(type, o.getClass()))
-// return (T)o;
-// throw new FormattedRuntimeException(
-// "Invalid object of type {0} found in call to PropertyStore.getTypeProperty({1},{2},{3},...)",
-// o.getClass(), name, type, def);
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// /**
-// * Returns a property value converted to a {@link LinkedHashMap} with the specified key and value types.
-// *
-// * @param name The full name of the property (e.g. <js>"BeanContext.sortProperties"</js>)
-// * @param keyType The class type of the keys in the map.
-// * @param valType The class type of the values in the map.
-// * @param def The default value if the property is not set.
-// * @return The property value.
-// * @throws ConfigException If property has a value that cannot be converted to a boolean.
-// */
-// public <K,V> Map<K,V> getMap(String name, Class<K> keyType, Class<V> valType, Map<K,V> def) {
-// rl.lock();
-// try {
-// PropertyMap pm = getPropertyMap(prefix(name));
-// if (pm != null)
-// return pm.getMap(name, keyType, valType, def);
-// return def;
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-//
-// //-------------------------------------------------------------------------------------
-// // Convenience methods.
-// //-------------------------------------------------------------------------------------
-//
-// /**
-// * Shortcut for calling <code>getContext(BeanContext.<jk>class</jk>);</code>.
-// *
-// * @return The bean context instance.
-// */
-// public BeanContext getBeanContext() {
-// return getContext(BeanContext.class);
-// }
-//
-// /**
-// * Shortcut for calling <code>setProperty(<jsf>BEAN_notBeanClasses</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#setProperty(String, Object)
-// * @see BeanContext#BEAN_notBeanClasses
-// */
-// public PropertyStore setNotBeanClasses(Class<?>...classes) {
-// setProperty(BEAN_notBeanClasses, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>addToProperty(<jsf>BEAN_notBeanClasses</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @see PropertyStore#addToProperty(String,Object)
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#addToProperty(String, Object)
-// * @see BeanContext#BEAN_notBeanClasses
-// */
-// public PropertyStore addNotBeanClasses(Class<?>...classes) {
-// addToProperty(BEAN_notBeanClasses, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>setProperty(<jsf>BEAN_beanFilters</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#setProperty(String, Object)
-// * @see BeanContext#BEAN_beanFilters
-// */
-// public PropertyStore setBeanFilters(Class<?>...classes) {
-// setProperty(BEAN_beanFilters, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>addToProperty(<jsf>BEAN_beanFilters</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#addToProperty(String, Object)
-// * @see BeanContext#BEAN_beanFilters
-// */
-// public PropertyStore addBeanFilters(Class<?>...classes) {
-// addToProperty(BEAN_beanFilters, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>setProperty(<jsf>BEAN_pojoSwaps</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#setProperty(String, Object)
-// * @see BeanContext#BEAN_pojoSwaps
-// */
-// public PropertyStore setPojoSwaps(Class<?>...classes) {
-// setProperty(BEAN_pojoSwaps, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>addToProperty(<jsf>BEAN_pojoSwaps</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#addToProperty(String, Object)
-// * @see BeanContext#BEAN_pojoSwaps
-// */
-// public PropertyStore addPojoSwaps(Class<?>...classes) {
-// addToProperty(BEAN_pojoSwaps, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>setProperty(<jsf>BEAN_beanDictionary</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#setProperty(String, Object)
-// * @see BeanContext#BEAN_beanDictionary
-// */
-// public PropertyStore setBeanDictionary(Class<?>...classes) {
-// addToProperty(BEAN_beanDictionary, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>addToProperty(<jsf>BEAN_beanDictionary</jsf>, <jf>classes</jf>)</code>.
-// *
-// * @param classes The new setting value for the bean context.
-// * @return This object (for method chaining).
-// * @see PropertyStore#addToProperty(String, Object)
-// * @see BeanContext#BEAN_beanDictionary
-// */
-// public PropertyStore addToBeanDictionary(Class<?>...classes) {
-// addToProperty(BEAN_beanDictionary, classes);
-// return this;
-// }
-//
-// /**
-// * Shortcut for calling <code>putTo(<jsf>BEAN_implCLasses</jsf>, <jf>interfaceClass</jf>, <jf>implClass</jf>)</code>.
-// *
-// * @param interfaceClass The interface class.
-// * @param implClass The implementation class.
-// * @param <T> The class type of the interface.
-// * @return This object (for method chaining).
-// * @see PropertyStore#putToProperty(String, Object, Object)
-// * @see BeanContext#BEAN_implClasses
-// */
-// public <T> PropertyStore addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) {
-// putToProperty(BEAN_implClasses, interfaceClass, implClass);
-// return this;
-// }
-//
-//
-// //-------------------------------------------------------------------------------------
-// // Object methods.
-// //-------------------------------------------------------------------------------------
-//
-// @Override /* Object */
-// public int hashCode() {
-// HashCode c = new HashCode();
-// for (PropertyMap m : properties.values())
-// c.add(m);
-// return c.get();
-// }
-//
-//
-// //--------------------------------------------------------------------------------
-// // Utility classes and methods.
-// //--------------------------------------------------------------------------------
-//
-// /**
-// * Hashcode generator that treats strings and primitive values the same.
-// * (e.g. <code>123</code> and <js>"123"</js> result in the same hashcode.)
-// */
-// static final class NormalizingHashCode extends HashCode {
-// @Override /* HashCode */
-// protected Object unswap(Object o) {
-// return PropertyStore.unswap(o);
-// }
-// }
-//
-// /**
-// * Contains all the properties for a particular property prefix (e.g. <js>'BeanContext'</js>)
-// *
-// * <p>
-// * Instances of this map are immutable from outside this class.
-// *
-// * <p>
-// * The {@link PropertyMap#hashCode()} and {@link PropertyMap#equals(Object)} methods can be used to compare with
-// * other property maps.
-// */
-// final class PropertyMap {
-//
-// private final Map<String,Property> map = new ConcurrentSkipListMap<>();
-// private volatile int hashCode = 0;
-// private final ReadWriteLock lock = new ReentrantReadWriteLock();
-// private final Lock rl = lock.readLock(), wl = lock.writeLock();
-// private final String prefix;
-//
-// PropertyMap(String prefix) {
-// this.prefix = prefix;
-// prefix = prefix + '.';
-// Properties p = System.getProperties();
-// for (Map.Entry<Object,Object> e : p.entrySet())
-// if (e.getKey().toString().startsWith(prefix))
-// set(e.getKey().toString(), e.getValue());
-// }
-//
-// /**
-// * Copy constructor.
-// */
-// PropertyMap(PropertyMap orig, PropertyMap apply) {
-// this.prefix = apply.prefix;
-// if (orig != null)
-// for (Map.Entry<String,Property> e : orig.map.entrySet())
-// this.map.put(e.getKey(), Property.create(e.getValue().name, e.getValue().value()));
-// for (Map.Entry<String,Property> e : apply.map.entrySet()) {
-// Property prev = this.map.get(e.getKey());
-// if (prev == null || "SIMPLE".equals(prev.type))
-// this.map.put(e.getKey(), Property.create(e.getValue().name, e.getValue().value()));
-// else {
-// if ("SET".equals(prev.type) || "LIST".equals(prev.type))
-// prev.add(e.getValue().value());
-// else if ("MAP".equals(prev.type))
-// prev.put(e.getValue().value());
-// }
-// }
-// }
-//
-// /**
-// * Returns the specified property as the specified class type.
-// *
-// * @param name The property name.
-// * @param type The type of object to convert the value to.
-// * @param def The default value if the specified property is not set.
-// * @return The property value.
-// */
-// <T> T get(String name, Class<T> type, T def) {
-// rl.lock();
-// try {
-// Property p = map.get(name);
-// if (p == null || type == null)
-// return def;
-// try {
-// if (! isBeanSessionAvailable())
-// return def;
-// return getBeanSession().convertToType(p.value, type);
-// } catch (InvalidDataConversionException e) {
-// throw new ConfigException("Could not retrieve property store property ''{0}''. {1}", p.name,
-// e.getMessage());
-// }
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// /**
-// * Returns the specified property as a map with the specified key and value types.
-// *
-// * <p>
-// * The map returned is an instance of {@link LinkedHashMap}.
-// *
-// * @param name The property name.
-// * @param keyType The class type of the keys of the map.
-// * @param valueType The class type of the values of the map.
-// * @param def The default value if the specified property is not set.
-// * @return The property value.
-// */
-// @SuppressWarnings("unchecked")
-// <K,V> Map<K,V> getMap(String name, Class<K> keyType, Class<V> valueType, Map<K,V> def) {
-// rl.lock();
-// try {
-// Property p = map.get(name);
-// if (p == null || keyType == null || valueType == null)
-// return def;
-// try {
-// if (isBeanSessionAvailable()) {
-// BeanSession session = getBeanSession();
-// return (Map<K,V>)session.convertToType(p.value,
-// session.getClassMeta(LinkedHashMap.class, keyType, valueType));
-// }
-// return def;
-// } catch (InvalidDataConversionException e) {
-// throw new ConfigException("Could not retrieve property store property ''{0}''. {1}", p.name,
-// e.getMessage());
-// }
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// /**
-// * Convenience method for returning all values in this property map as a simple map.
-// *
-// * <p>
-// * Primarily useful for debugging.
-// *
-// * @return A new {@link LinkedHashMap} with all values in this property map.
-// */
-// Map<String,Object> asMap() {
-// rl.lock();
-// try {
-// Map<String,Object> m = new LinkedHashMap<>();
-// for (Property p : map.values())
-// m.put(p.name, p.value);
-// return m;
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// void set(String name, Object value) {
-// wl.lock();
-// hashCode = 0;
-// try {
-// if (value == null)
-// map.remove(name);
-// else
-// map.put(name, Property.create(name, value));
-// } finally {
-// wl.unlock();
-// }
-// }
-//
-// void addTo(String name, Object value) {
-// wl.lock();
-// hashCode = 0;
-// try {
-// if (! map.containsKey(name))
-// map.put(name, Property.create(name, Collections.emptyList()));
-// map.get(name).add(value);
-// } finally {
-// wl.unlock();
-// }
-// }
-//
-// void putTo(String name, Object key, Object value) {
-// wl.lock();
-// hashCode = 0;
-// try {
-// if (! map.containsKey(name))
-// map.put(name, Property.create(name, Collections.emptyMap()));
-// map.get(name).put(key, value);
-// } finally {
-// wl.unlock();
-// }
-// }
-//
-// void putTo(String name, Object value) {
-// wl.lock();
-// hashCode = 0;
-// try {
-// if (! map.containsKey(name))
-// map.put(name, Property.create(name, Collections.emptyMap()));
-// map.get(name).put(value);
-// } finally {
-// wl.unlock();
-// }
-// }
-//
-// void removeFrom(String name, Object value) {
-// wl.lock();
-// hashCode = 0;
-// try {
-// if (map.containsKey(name))
-// map.get(name).remove(value);
-// } finally {
-// wl.unlock();
-// }
-// }
-//
-// @Override
-// public int hashCode() {
-// rl.lock();
-// try {
-// if (hashCode == 0) {
-// HashCode c = new HashCode().add(prefix);
-// for (Property p : map.values())
-// c.add(p);
-// this.hashCode = c.get();
-// }
-// return hashCode;
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// @Override
-// public boolean equals(Object o) {
-// rl.lock();
-// try {
-// if (o instanceof PropertyMap) {
-// PropertyMap m = (PropertyMap)o;
-// if (m.hashCode() != hashCode())
-// return false;
-// return this.map.equals(m.map);
-// }
-// return false;
-// } finally {
-// rl.unlock();
-// }
-// }
-//
-// @Override
-// public String toString() {
-// return "PropertyMap(id="+System.identityHashCode(this)+")";
-// }
-// }
-//
-// private abstract static class Property {
-// final String name, type;
-// final Object value;
-//
-// static final Property create(String name, Object value) {
-// if (name.endsWith(".ss") || name.endsWith(".sb") || name.endsWith(".si") || name.endsWith(".sc") || name.endsWith(".so"))
-// return new SetProperty(name, value);
-// else if (name.endsWith(".ls") || name.endsWith(".lb") || name.endsWith(".li") || name.endsWith(".lc") || name.endsWith(".lo"))
-// return new ListProperty(name, value);
-// else if (name.endsWith(".ms") || name.endsWith(".mb") || name.endsWith(".mi") || name.endsWith(".mc") || name.endsWith(".mo"))
-// return new MapProperty(name, value);
-// return new SimpleProperty(name, value);
-// }
-//
-// Property(String name, String type, Object value) {
-// this.name = name;
-// this.type = type;
-// this.value = value;
-// }
-//
-// void add(Object val) {
-// throw new ConfigException("Cannot add value {0} ({1}) to property ''{2}'' ({3}).",
-// JsonSerializer.DEFAULT_LAX.toString(val), getReadableClassNameForObject(val), name, type);
-// }
-//
-// void remove(Object val) {
-// throw new ConfigException("Cannot remove value {0} ({1}) from property ''{2}'' ({3}).",
-// JsonSerializer.DEFAULT_LAX.toString(val), getReadableClassNameForObject(val), name, type);
-// }
-//
-// void put(Object val) {
-// throw new ConfigException("Cannot put value {0} ({1}) to property ''{2}'' ({3}).",
-// JsonSerializer.DEFAULT_LAX.toString(val), getReadableClassNameForObject(val), name, type);
-// }
-//
-// void put(Object key, Object val) {
-// throw new ConfigException("Cannot put value {0}({1})->{2}({3}) to property ''{4}'' ({5}).",
-// JsonSerializer.DEFAULT_LAX.toString(key), getReadableClassNameForObject(key),
-// JsonSerializer.DEFAULT_LAX.toString(val), getReadableClassNameForObject(val), name, type);
-// }
-//
-// protected Object value() {
-// return value;
-// }
-//
-// @Override /* Object */
-// public int hashCode() {
-// HashCode c = new NormalizingHashCode().add(name);
-// if (value instanceof Map) {
-// for (Map.Entry<?,?> e : ((Map<?,?>)value).entrySet())
-// c.add(e.getKey()).add(e.getValue());
-// } else if (value instanceof Collection) {
-// for (Object o : (Collection<?>)value)
-// c.add(o);
-// } else {
-// c.add(value);
-// }
-// return c.get();
-// }
-//
-// @Override
-// public String toString() {
-// return "Property(name="+name+",type="+type+")";
-// }
-// }
-//
-// private static final class SimpleProperty extends Property {
-//
-// SimpleProperty(String name, Object value) {
-// super(name, "SIMPLE", value);
-// }
-// }
-//
-// @SuppressWarnings({"unchecked"})
-// private static final class SetProperty extends Property {
-// private final Set<Object> value;
-//
-// SetProperty(String name, Object value) {
-// super(name, "SET", new ConcurrentSkipListSet<>(PROPERTY_COMPARATOR));
-// this.value = (Set<Object>)value();
-// add(value);
-// }
-//
-// @Override
-// void add(Object val) {
-// if (val.getClass().isArray())
-// for (int i = 0; i < Array.getLength(val); i++)
-// add(Array.get(val, i));
-// else if (val instanceof Collection)
-// for (Object o : (Collection<Object>)val)
-// add(o);
-// else {
-// if (val instanceof String) {
-// String s = val.toString();
-// if (s.startsWith("[") && s.endsWith("]")) {
-// try {
-// add(new ObjectList(s));
-// return;
-// } catch (Exception e) {}
-// }
-// }
-// for (Object o : value)
-// if (same(val, o))
-// return;
-// value.add(val);
-// }
-// }
-//
-// @Override
-// void remove(Object val) {
-// if (val.getClass().isArray())
-// for (int i = 0; i < Array.getLength(val); i++)
-// remove(Array.get(val, i));
-// else if (val instanceof Collection)
-// for (Object o : (Collection<Object>)val)
-// remove(o);
-// else {
-// if (val instanceof String) {
-// String s = val.toString();
-// if (s.startsWith("[") && s.endsWith("]")) {
-// try {
-// remove(new ObjectList(s));
-// return;
-// } catch (Exception e) {}
-// }
-// }
-// for (Iterator<Object> i = value.iterator(); i.hasNext();)
-// if (same(i.next(), val))
-// i.remove();
-// }
-// }
-// }
-//
-// @SuppressWarnings({"unchecked"})
-// private static final class ListProperty extends Property {
-// private final LinkedList<Object> value;
-//
-// ListProperty(String name, Object value) {
-// super(name, "LIST", new LinkedList<>());
-// this.value = (LinkedList<Object>)value();
-// add(value);
-// }
-//
-// @Override
-// void add(Object val) {
-// if (val.getClass().isArray()) {
-// for (int i = Array.getLength(val) - 1; i >= 0; i--)
-// add(Array.get(val, i));
-// } else if (val instanceof List) {
-// List<Object> l = (List<Object>)val;
-// for (ListIterator<Object> i = l.listIterator(l.size()); i.hasPrevious();)
-// add(i.previous());
-// } else if (val instanceof Collection) {
-// List<Object> l = new ArrayList<>((Collection<Object>)val);
-// for (ListIterator<Object> i = l.listIterator(l.size()); i.hasPrevious();)
-// add(i.previous());
-// } else {
-// String s = val.toString();
-// if (s.startsWith("[") && s.endsWith("]")) {
-// try {
-// add(new ObjectList(s));
-// return;
-// } catch (Exception e) {}
-// }
-// for (Iterator<Object> i = value.iterator(); i.hasNext(); )
-// if (same(val, i.next()))
-// i.remove();
-// value.addFirst(val);
-// }
-// }
-//
-// @Override
-// void remove(Object val) {
-// if (val.getClass().isArray())
-// for (int i = 0; i < Array.getLength(val); i++)
-// remove(Array.get(val, i));
-// else if (val instanceof Collection)
-// for (Object o : (Collection<Object>)val)
-// remove(o);
-// else {
-// String s = val.toString();
-// if (s.startsWith("[") && s.endsWith("]")) {
-// try {
-// remove(new ObjectList(s));
-// return;
-// } catch (Exception e) {}
-// }
-// for (Iterator<Object> i = value.iterator(); i.hasNext();)
-// if (same(i.next(), val))
-// i.remove();
-// }
-// }
-// }
-//
-// @SuppressWarnings({"unchecked","rawtypes"})
-// private static final class MapProperty extends Property {
-// final Map<Object,Object> value;
-//
-// MapProperty(String name, Object value) {
-// // ConcurrentSkipListMap doesn't support Map.Entry.remove(), so use TreeMap instead.
-// super(name, "MAP", Collections.synchronizedMap(new TreeMap<>(PROPERTY_COMPARATOR)));
-// this.value = (Map<Object,Object>)value();
-// put(value);
-// }
-//
-// @Override
-// void put(Object val) {
-// try {
-// if (isBeanSessionAvailable() && ! (val instanceof Map))
-// val = getBeanSession().convertToType(val, Map.class);
-// if (val instanceof Map) {
-// Map m = (Map)val;
-// for (Map.Entry e : (Set<Map.Entry>)m.entrySet())
-// put(e.getKey(), e.getValue());
-// return;
-// }
-// } catch (Exception e) {}
-// super.put(val);
-// }
-//
-// @Override
-// void put(Object key, Object val) {
-// // ConcurrentSkipListMap doesn't support Map.Entry.remove().
-// for (Map.Entry<Object,Object> e : value.entrySet()) {
-// if (same(e.getKey(), key)) {
-// e.setValue(val);
-// return;
-// }
-// }
-// value.put(key, val);
-// }
-// }
-//
-// /**
-// * Converts an object to a normalized form for comparison purposes.
-// *
-// * @param o The object to normalize.
-// * @return The normalized object.
-// */
-// static Object unswap(Object o) {
-// if (o instanceof Class)
-// return ((Class<?>)o).getName();
-// if (o instanceof Number || o instanceof Boolean)
-// return o.toString();
-// return o;
-// }
-//
-// static BeanSession getBeanSession() {
-// if (beanSession == null && BeanContext.DEFAULT != null)
-// beanSession = BeanContext.DEFAULT.createSession();
-// return beanSession;
-// }
-//
-// /**
-// * Returns true if a bean session is available.
-// *
-// * <p>
-// * Note that a bean session will not be available when constructing the BeanContext.DEFAULT context.
-// * (it's a chicken-and-egg thing).
-// */
-// static boolean isBeanSessionAvailable() {
-// return getBeanSession() != null;
-// }
-//
-// /*
-// * Compares two objects for "string"-equality.
-// * Basically mean both objects are equal if they're the same when converted to strings.
-// */
-// @SuppressWarnings({ "rawtypes" })
-// static boolean same(Object o1, Object o2) {
-// if (o1 == o2)
-// return true;
-// if (o1 instanceof Map) {
-// if (o2 instanceof Map) {
-// Map m1 = (Map)o1, m2 = (Map)o2;
-// if (m1.size() == m2.size()) {
-// Set<Map.Entry> s1 = m1.entrySet(), s2 = m2.entrySet();
-// for (Iterator<Map.Entry> i1 = s1.iterator(), i2 = s2.iterator(); i1.hasNext();) {
-// Map.Entry e1 = i1.next(), e2 = i2.next();
-// if (! same(e1.getKey(), e2.getKey()))
-// return false;
-// if (! same(e1.getValue(), e2.getValue()))
-// return false;
-// }
-// return true;
-// }
-// }
-// return false;
-// } else if (o1 instanceof Collection) {
-// if (o2 instanceof Collection) {
-// Collection c1 = (Collection)o1, c2 = (Collection)o2;
-// if (c1.size() == c2.size()) {
-// for (Iterator i1 = c1.iterator(), i2 = c2.iterator(); i1.hasNext();) {
-// if (! same(i1.next(), i2.next()))
-// return false;
-// }
-// return true;
-// }
-// }
-// return false;
-// } else {
-// return unswap(o1).equals(unswap(o2));
-// }
-// }
-//
-// private static String prefix(String name) {
-// if (name == null)
-// throw new ConfigException("Invalid property name specified: 'null'");
-// if (name.indexOf('.') == -1)
-// return "";
-// return name.substring(0, name.indexOf('.'));
-// }
-//
-// private static String className(Object o) {
-// if (o == null)
-// return null;
-// if (o instanceof Class)
-// return getReadableClassName((Class<?>)o);
-// return getReadableClassName(o.getClass());
-// }
-//
-// @Override /* Object */
-// public String toString() {
-// rl.lock();
-// try {
-// ObjectMap m = new ObjectMap();
-// m.put("id", System.identityHashCode(this));
-// m.put("hashCode", hashCode());
-// m.put("properties.id", System.identityHashCode(properties));
-// m.put("contexts.id", System.identityHashCode(contexts));
-// m.put("properties", properties);
-// m.put("contexts", contexts);
-// return m.toString();
-// } finally {
-// rl.unlock();
-// }
-// }
-}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyType.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyType.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyType.java
index 55ed7d9..a0d352c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyType.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyType.java
@@ -17,7 +17,7 @@ import static org.apache.juneau.PropertyConverter.*;
import java.util.*;
/**
- * Represents possible property types of properties in a {@link PropertyStore2}.
+ * Represents possible property types of properties in a {@link PropertyStore}.
*/
@SuppressWarnings({"unchecked","rawtypes"})
public enum PropertyType {
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
index d7f2f15..5bc8e66 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
@@ -25,7 +25,7 @@ public class CsvParser extends ReaderParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final CsvParser DEFAULT = new CsvParser(PropertyStore2.DEFAULT);
+ public static final CsvParser DEFAULT = new CsvParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -37,7 +37,7 @@ public class CsvParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public CsvParser(PropertyStore2 ps) {
+ public CsvParser(PropertyStore ps) {
super(ps, "text/csv");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
index 022255d..c51dbeb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
@@ -35,7 +35,7 @@ public class CsvParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public CsvParserBuilder(PropertyStore2 ps) {
+ public CsvParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -451,7 +451,7 @@ public class CsvParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public CsvParserBuilder apply(PropertyStore2 copyFrom) {
+ public CsvParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
index 9bc6a87..1bc274c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
@@ -25,7 +25,7 @@ public final class CsvSerializer extends WriterSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings.*/
- public static final CsvSerializer DEFAULT = new CsvSerializer(PropertyStore2.DEFAULT);
+ public static final CsvSerializer DEFAULT = new CsvSerializer(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -37,7 +37,7 @@ public final class CsvSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public CsvSerializer(PropertyStore2 ps) {
+ public CsvSerializer(PropertyStore ps) {
super(ps, "text/csv");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
index fbed4d4..323b998 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
@@ -35,7 +35,7 @@ public class CsvSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public CsvSerializerBuilder(PropertyStore2 ps) {
+ public CsvSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -578,7 +578,7 @@ public class CsvSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public CsvSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public CsvSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index a33d094..bdda028 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -493,7 +493,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings. */
- public static final HtmlDocSerializer DEFAULT = new HtmlDocSerializer(PropertyStore2.DEFAULT);
+ public static final HtmlDocSerializer DEFAULT = new HtmlDocSerializer(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -510,7 +510,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public HtmlDocSerializer(PropertyStore2 ps) {
+ public HtmlDocSerializer(PropertyStore ps) {
this(ps, "text/html");
}
@@ -535,7 +535,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public HtmlDocSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public HtmlDocSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
style = getArrayProperty(HTMLDOC_style, String.class);
stylesheet = getArrayProperty(HTMLDOC_stylesheet, String.class);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
index 9fbcb4b..48356e3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
@@ -36,7 +36,7 @@ public class HtmlParser extends XmlParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final HtmlParser DEFAULT = new HtmlParser(PropertyStore2.DEFAULT);
+ public static final HtmlParser DEFAULT = new HtmlParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -48,7 +48,7 @@ public class HtmlParser extends XmlParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public HtmlParser(PropertyStore2 ps) {
+ public HtmlParser(PropertyStore ps) {
super(ps, "text/html", "text/html+stripped");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
index 37a2a53..78778fc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
@@ -39,7 +39,7 @@ public class HtmlParserBuilder extends XmlParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public HtmlParserBuilder(PropertyStore2 ps) {
+ public HtmlParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -480,7 +480,7 @@ public class HtmlParserBuilder extends XmlParserBuilder {
}
@Override /* ContextBuilder */
- public HtmlParserBuilder apply(PropertyStore2 copyFrom) {
+ public HtmlParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
index 8c5570d..f538e9c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
@@ -44,7 +44,7 @@ public final class HtmlSchemaDocSerializer extends HtmlDocSerializer {
* @param ps
* The property store to use for creating the context for this serializer.
*/
- public HtmlSchemaDocSerializer(PropertyStore2 ps) {
+ public HtmlSchemaDocSerializer(PropertyStore ps) {
this(ps, "text/html", "text/html+schema");
}
@@ -69,7 +69,7 @@ public final class HtmlSchemaDocSerializer extends HtmlDocSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public HtmlSchemaDocSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public HtmlSchemaDocSerializer(PropertyStore ps, String produces, String...accept) {
super(
ps.builder()
.set(SERIALIZER_detectRecursions, true)
[2/4] juneau git commit: (JUNEAU-76) Improvements to Context/Builder
APIs
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
index 06da1f4..788866a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
@@ -236,13 +236,13 @@ public class HtmlSerializer extends XmlSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings. */
- public static final HtmlSerializer DEFAULT = new HtmlSerializer(PropertyStore2.DEFAULT);
+ public static final HtmlSerializer DEFAULT = new HtmlSerializer(PropertyStore.DEFAULT);
/** Default serializer, single quotes. */
- public static final HtmlSerializer DEFAULT_SQ = new HtmlSerializer.Sq(PropertyStore2.DEFAULT);
+ public static final HtmlSerializer DEFAULT_SQ = new HtmlSerializer.Sq(PropertyStore.DEFAULT);
/** Default serializer, single quotes, whitespace added. */
- public static final HtmlSerializer DEFAULT_SQ_READABLE = new HtmlSerializer.SqReadable(PropertyStore2.DEFAULT);
+ public static final HtmlSerializer DEFAULT_SQ_READABLE = new HtmlSerializer.SqReadable(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -257,7 +257,7 @@ public class HtmlSerializer extends XmlSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Sq(PropertyStore2 ps) {
+ public Sq(PropertyStore ps) {
super(
ps.builder()
.set(SERIALIZER_quoteChar, '\'')
@@ -274,7 +274,7 @@ public class HtmlSerializer extends XmlSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public SqReadable(PropertyStore2 ps) {
+ public SqReadable(PropertyStore ps) {
super(
ps.builder()
.set(SERIALIZER_quoteChar, '\'')
@@ -305,7 +305,7 @@ public class HtmlSerializer extends XmlSerializer {
* @param ps
* The property store containing all the settings for this object.
*/
- public HtmlSerializer(PropertyStore2 ps) {
+ public HtmlSerializer(PropertyStore ps) {
this(ps, "text/html");
}
@@ -330,7 +330,7 @@ public class HtmlSerializer extends XmlSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public HtmlSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public HtmlSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
uriAnchorText = getProperty(HTML_uriAnchorText, AnchorText.class, AnchorText.TO_STRING);
lookForLabelParameters = getProperty(HTML_lookForLabelParameters, boolean.class, true);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
index 36d9a42..a25aef6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
@@ -38,7 +38,7 @@ public class HtmlSerializerBuilder extends XmlSerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public HtmlSerializerBuilder(PropertyStore2 ps) {
+ public HtmlSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -712,7 +712,7 @@ public class HtmlSerializerBuilder extends XmlSerializerBuilder {
}
@Override /* ContextBuilder */
- public HtmlSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public HtmlSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
index b338395..1676dbb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
@@ -38,7 +38,7 @@ public class HtmlStrippedDocSerializer extends HtmlSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public HtmlStrippedDocSerializer(PropertyStore2 ps) {
+ public HtmlStrippedDocSerializer(PropertyStore ps) {
this(ps, "text/html", "text/html+stripped");
}
@@ -63,7 +63,7 @@ public class HtmlStrippedDocSerializer extends HtmlSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public HtmlStrippedDocSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public HtmlStrippedDocSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParser.java
index 7d90acf..55b9dc4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParser.java
@@ -31,7 +31,7 @@ public final class JsoParser extends InputStreamParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final JsoParser DEFAULT = new JsoParser(PropertyStore2.DEFAULT);
+ public static final JsoParser DEFAULT = new JsoParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -43,7 +43,7 @@ public final class JsoParser extends InputStreamParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public JsoParser(PropertyStore2 ps) {
+ public JsoParser(PropertyStore ps) {
super(ps, "application/x-java-serialized-object");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParserBuilder.java
index b9dd2bb..e84b9d0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoParserBuilder.java
@@ -35,7 +35,7 @@ public class JsoParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public JsoParserBuilder(PropertyStore2 ps) {
+ public JsoParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -452,7 +452,7 @@ public class JsoParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public JsoParserBuilder apply(PropertyStore2 copyFrom) {
+ public JsoParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializer.java
index 43da003..4a15da4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializer.java
@@ -34,7 +34,7 @@ public class JsoSerializer extends OutputStreamSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings.*/
- public static final JsoSerializer DEFAULT = new JsoSerializer(PropertyStore2.DEFAULT);
+ public static final JsoSerializer DEFAULT = new JsoSerializer(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -46,7 +46,7 @@ public class JsoSerializer extends OutputStreamSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public JsoSerializer(PropertyStore2 ps) {
+ public JsoSerializer(PropertyStore ps) {
super(ps, "application/x-java-serialized-object");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
index e0c500d..529e078 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
@@ -35,7 +35,7 @@ public class JsoSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public JsoSerializerBuilder(PropertyStore2 ps) {
+ public JsoSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -578,7 +578,7 @@ public class JsoSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public JsoSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public JsoSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
index 5f0c051..15cb118 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
@@ -51,7 +51,7 @@ import org.apache.juneau.parser.*;
* JSON objects (<js>"{...}"</js>) are converted to {@link ObjectMap ObjectMaps}.
* <b>Note:</b> If a <code><xa>_type</xa>=<xs>'xxx'</xs></code> attribute is specified on the object, then an
* attempt is made to convert the object to an instance of the specified Java bean class.
- * See the <code>beanTypeName</code> setting on the {@link PropertyStore2} for more information about parsing
+ * See the <code>beanTypeName</code> setting on the {@link PropertyStore} for more information about parsing
* beans from JSON.
* <li>
* JSON arrays (<js>"[...]"</js>) are converted to {@link ObjectList ObjectLists}.
@@ -105,10 +105,10 @@ public class JsonParser extends ReaderParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final JsonParser DEFAULT = new JsonParser(PropertyStore2.DEFAULT);
+ public static final JsonParser DEFAULT = new JsonParser(PropertyStore.DEFAULT);
/** Default parser, all default settings.*/
- public static final JsonParser DEFAULT_STRICT = new JsonParser.Strict(PropertyStore2.DEFAULT);
+ public static final JsonParser DEFAULT_STRICT = new JsonParser.Strict(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -123,7 +123,7 @@ public class JsonParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public Strict(PropertyStore2 ps) {
+ public Strict(PropertyStore ps) {
super(ps.builder().set(PARSER_strict, true).build());
}
}
@@ -138,7 +138,7 @@ public class JsonParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public JsonParser(PropertyStore2 ps) {
+ public JsonParser(PropertyStore ps) {
this(ps, "application/json", "text/json");
}
@@ -148,7 +148,7 @@ public class JsonParser extends ReaderParser {
* @param ps The property store containing all the settings for this object.
* @param consumes The list of media types that this parser consumes (e.g. <js>"application/json"</js>).
*/
- public JsonParser(PropertyStore2 ps, String...consumes) {
+ public JsonParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserBuilder.java
index 2721b4e..4d83265 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserBuilder.java
@@ -35,7 +35,7 @@ public class JsonParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public JsonParserBuilder(PropertyStore2 ps) {
+ public JsonParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -452,7 +452,7 @@ public class JsonParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public JsonParserBuilder apply(PropertyStore2 copyFrom) {
+ public JsonParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
index 93f01d3..e2aed0a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
@@ -35,7 +35,7 @@ public final class JsonSchemaSerializer extends JsonSerializer {
*
* @param ps Initialize with the specified config property store.
*/
- public JsonSchemaSerializer(PropertyStore2 ps) {
+ public JsonSchemaSerializer(PropertyStore ps) {
super(
ps.builder()
.set(SERIALIZER_detectRecursions, true)
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
index 544f8b8..4d567f1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
@@ -35,7 +35,7 @@ public class JsonSchemaSerializerBuilder extends JsonSerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public JsonSchemaSerializerBuilder(PropertyStore2 ps) {
+ public JsonSchemaSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -590,7 +590,7 @@ public class JsonSchemaSerializerBuilder extends JsonSerializerBuilder {
}
@Override /* ContextBuilder */
- public JsonSchemaSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public JsonSchemaSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
index 6711f08..9869290 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -157,22 +157,22 @@ public class JsonSerializer extends WriterSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings.*/
- public static final JsonSerializer DEFAULT = new JsonSerializer(PropertyStore2.DEFAULT);
+ public static final JsonSerializer DEFAULT = new JsonSerializer(PropertyStore.DEFAULT);
/** Default serializer, all default settings.*/
- public static final JsonSerializer DEFAULT_READABLE = new Readable(PropertyStore2.DEFAULT);
+ public static final JsonSerializer DEFAULT_READABLE = new Readable(PropertyStore.DEFAULT);
/** Default serializer, single quotes, simple mode. */
- public static final JsonSerializer DEFAULT_LAX = new Simple(PropertyStore2.DEFAULT);
+ public static final JsonSerializer DEFAULT_LAX = new Simple(PropertyStore.DEFAULT);
/** Default serializer, single quotes, simple mode, with whitespace. */
- public static final JsonSerializer DEFAULT_LAX_READABLE = new SimpleReadable(PropertyStore2.DEFAULT);
+ public static final JsonSerializer DEFAULT_LAX_READABLE = new SimpleReadable(PropertyStore.DEFAULT);
/**
* Default serializer, single quotes, simple mode, with whitespace and recursion detection.
* Note that recursion detection introduces a small performance penalty.
*/
- public static final JsonSerializer DEFAULT_LAX_READABLE_SAFE = new SimpleReadableSafe(PropertyStore2.DEFAULT);
+ public static final JsonSerializer DEFAULT_LAX_READABLE_SAFE = new SimpleReadableSafe(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -187,7 +187,7 @@ public class JsonSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Readable(PropertyStore2 ps) {
+ public Readable(PropertyStore ps) {
super(
ps.builder().set(SERIALIZER_useWhitespace, true).build()
);
@@ -202,7 +202,7 @@ public class JsonSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Simple(PropertyStore2 ps) {
+ public Simple(PropertyStore ps) {
super(
ps.builder()
.set(JSON_simpleMode, true)
@@ -222,7 +222,7 @@ public class JsonSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public SimpleReadable(PropertyStore2 ps) {
+ public SimpleReadable(PropertyStore ps) {
super(
ps.builder()
.set(JSON_simpleMode, true)
@@ -244,7 +244,7 @@ public class JsonSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public SimpleReadableSafe(PropertyStore2 ps) {
+ public SimpleReadableSafe(PropertyStore ps) {
super(
ps.builder()
.set(JSON_simpleMode, true)
@@ -274,7 +274,7 @@ public class JsonSerializer extends WriterSerializer {
* @param ps
* The property store containing all the settings for this object.
*/
- public JsonSerializer(PropertyStore2 ps) {
+ public JsonSerializer(PropertyStore ps) {
this(ps, "application/json", "application/json", "application/json+*", "text/json", "text/json+*");
}
@@ -299,7 +299,7 @@ public class JsonSerializer extends WriterSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public JsonSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public JsonSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
simpleMode = getProperty(JSON_simpleMode, boolean.class, false);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
index 8e1a539..016a006 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
@@ -37,7 +37,7 @@ public class JsonSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public JsonSerializerBuilder(PropertyStore2 ps) {
+ public JsonSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -631,7 +631,7 @@ public class JsonSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public JsonSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public JsonSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
index 3ebed35..48960f3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
@@ -29,7 +29,7 @@ public class MsgPackParser extends InputStreamParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final MsgPackParser DEFAULT = new MsgPackParser(PropertyStore2.DEFAULT);
+ public static final MsgPackParser DEFAULT = new MsgPackParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -41,7 +41,7 @@ public class MsgPackParser extends InputStreamParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public MsgPackParser(PropertyStore2 ps) {
+ public MsgPackParser(PropertyStore ps) {
super(ps, "octal/msgpack");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParserBuilder.java
index 2cca935..b2edede 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParserBuilder.java
@@ -35,7 +35,7 @@ public class MsgPackParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public MsgPackParserBuilder(PropertyStore2 ps) {
+ public MsgPackParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -452,7 +452,7 @@ public class MsgPackParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public MsgPackParserBuilder apply(PropertyStore2 copyFrom) {
+ public MsgPackParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
index 50d8f5d..c94cd85 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
@@ -62,7 +62,7 @@ public class MsgPackSerializer extends OutputStreamSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings.*/
- public static final MsgPackSerializer DEFAULT = new MsgPackSerializer(PropertyStore2.DEFAULT);
+ public static final MsgPackSerializer DEFAULT = new MsgPackSerializer(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -77,7 +77,7 @@ public class MsgPackSerializer extends OutputStreamSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public MsgPackSerializer(PropertyStore2 ps) {
+ public MsgPackSerializer(PropertyStore ps) {
super(ps, "octal/msgpack");
this.addBeanTypeProperties = getProperty(MSGPACK_addBeanTypeProperties, boolean.class, getProperty(SERIALIZER_addBeanTypeProperties, boolean.class, true));
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
index affc9e1..1121eeb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
@@ -35,7 +35,7 @@ public class MsgPackSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public MsgPackSerializerBuilder(PropertyStore2 ps) {
+ public MsgPackSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -578,7 +578,7 @@ public class MsgPackSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public MsgPackSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public MsgPackSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
index 6fe68a3..62518b9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
@@ -33,7 +33,7 @@ public abstract class InputStreamParser extends Parser {
* @param ps The property store containing all the settings for this object.
* @param consumes The list of media types that this parser consumes (e.g. <js>"application/json"</js>).
*/
- protected InputStreamParser(PropertyStore2 ps, String...consumes) {
+ protected InputStreamParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
index f7ae227..7bee122 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
@@ -251,7 +251,7 @@ public abstract class Parser extends BeanContext {
*/
public static final String PARSER_listener = PREFIX + "listener.c";
- static Parser DEFAULT = new Parser(PropertyStore2.create().build()) {
+ static Parser DEFAULT = new Parser(PropertyStore.create().build()) {
@Override
public ParserSession createSession(ParserSessionArgs args) {
throw new NoSuchMethodError();
@@ -270,7 +270,7 @@ public abstract class Parser extends BeanContext {
private final MediaType[] consumes;
// Hidden constructor to force subclass from InputStreamParser or ReaderParser.
- Parser(PropertyStore2 ps, String...consumes) {
+ Parser(PropertyStore ps, String...consumes) {
super(ps);
trimStrings = getProperty(PARSER_trimStrings, boolean.class, false);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
index 62e725c..b8b1725 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
@@ -37,7 +37,7 @@ public class ParserBuilder extends BeanContextBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public ParserBuilder(PropertyStore2 ps) {
+ public ParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -549,7 +549,7 @@ public class ParserBuilder extends BeanContextBuilder {
}
@Override /* ContextBuilder */
- public ParserBuilder apply(PropertyStore2 copyFrom) {
+ public ParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroup.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroup.java
index da1a2ad..da7bb70 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroup.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroup.java
@@ -78,7 +78,7 @@ public final class ParserGroup {
private final List<MediaType> mediaTypesList;
private final Parser[] mediaTypeParsers;
private final List<Parser> parsers;
- private final PropertyStore2 propertyStore;
+ private final PropertyStore propertyStore;
/**
* Instantiates a new clean-slate {@link ParserGroupBuilder} object.
@@ -112,7 +112,7 @@ public final class ParserGroup {
* The order is important because they will be tried in reverse order (e.g. newer first) in which they will be
* tried to match against media types.
*/
- public ParserGroup(PropertyStore2 ps, Parser[] parsers) {
+ public ParserGroup(PropertyStore ps, Parser[] parsers) {
this.propertyStore = ps;
this.parsers = Collections.unmodifiableList(new ArrayList<>(Arrays.asList(parsers)));
@@ -207,7 +207,7 @@ public final class ParserGroup {
*
* @return A new copy of the property store passed in to the constructor.
*/
- public PropertyStore2 getPropertyStore() {
+ public PropertyStore getPropertyStore() {
return propertyStore;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroupBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroupBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroupBuilder.java
index 685b9a7..75c0091 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroupBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserGroupBuilder.java
@@ -35,7 +35,7 @@ public class ParserGroupBuilder {
*/
public ParserGroupBuilder() {
this.parsers = new ArrayList<>();
- this.propertyStore = PropertyStore2.create();
+ this.propertyStore = PropertyStore.create();
}
/**
@@ -108,7 +108,7 @@ public class ParserGroupBuilder {
List<Parser> l = new ArrayList<>();
for (Object p : parsers) {
Class<? extends Parser> c = null;
- PropertyStore2 ps = propertyStore.build();
+ PropertyStore ps = propertyStore.build();
if (p instanceof Class) {
c = (Class<? extends Parser>)p;
} else {
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
index 033fccc..693fc12 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
@@ -33,7 +33,7 @@ public abstract class ReaderParser extends Parser {
* @param ps The property store containing all the settings for this object.
* @param consumes The list of media types that this parser consumes (e.g. <js>"application/json"</js>, <js>"*​/json"</js>).
*/
- protected ReaderParser(PropertyStore2 ps, String...consumes) {
+ protected ReaderParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
index 1e3fd7f..c1156d0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
@@ -43,7 +43,7 @@ public class PlainTextParser extends ReaderParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final PlainTextParser DEFAULT = new PlainTextParser(PropertyStore2.DEFAULT);
+ public static final PlainTextParser DEFAULT = new PlainTextParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -55,7 +55,7 @@ public class PlainTextParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public PlainTextParser(PropertyStore2 ps) {
+ public PlainTextParser(PropertyStore ps) {
this(ps, "text/plain");
}
@@ -68,7 +68,7 @@ public class PlainTextParser extends ReaderParser {
* Can contain meta-characters per the <code>media-type</code> specification of
* <a class="doclink" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">RFC2616/14.1</a>
*/
- public PlainTextParser(PropertyStore2 ps, String...consumes) {
+ public PlainTextParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParserBuilder.java
index b87c507..038b74b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParserBuilder.java
@@ -35,7 +35,7 @@ public class PlainTextParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public PlainTextParserBuilder(PropertyStore2 ps) {
+ public PlainTextParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -452,7 +452,7 @@ public class PlainTextParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public PlainTextParserBuilder apply(PropertyStore2 copyFrom) {
+ public PlainTextParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
index 027aa29..bf9c176 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
@@ -41,7 +41,7 @@ public class PlainTextSerializer extends WriterSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings.*/
- public static final PlainTextSerializer DEFAULT = new PlainTextSerializer(PropertyStore2.DEFAULT);
+ public static final PlainTextSerializer DEFAULT = new PlainTextSerializer(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -54,7 +54,7 @@ public class PlainTextSerializer extends WriterSerializer {
* @param ps
* The property store containing all the settings for this object.
*/
- public PlainTextSerializer(PropertyStore2 ps) {
+ public PlainTextSerializer(PropertyStore ps) {
this(ps, "text/plain");
}
@@ -79,7 +79,7 @@ public class PlainTextSerializer extends WriterSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public PlainTextSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public PlainTextSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
index 687924a..5561073 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
@@ -35,7 +35,7 @@ public class PlainTextSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public PlainTextSerializerBuilder(PropertyStore2 ps) {
+ public PlainTextSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -578,7 +578,7 @@ public class PlainTextSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public PlainTextSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public PlainTextSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
index 1387095..8e9d648 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
@@ -42,7 +42,7 @@ public abstract class OutputStreamSerializer extends Serializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- protected OutputStreamSerializer(PropertyStore2 ps, String produces, String...accept) {
+ protected OutputStreamSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index 1969ada..311bfd1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -431,7 +431,7 @@ public abstract class Serializer extends BeanContext {
public static final String SERIALIZER_listener = PREFIX + "listener.c";
- static final Serializer DEFAULT = new Serializer(PropertyStore2.create().build(), "") {
+ static final Serializer DEFAULT = new Serializer(PropertyStore.create().build(), "") {
@Override
public SerializerSession createSession(SerializerSessionArgs args) {
throw new NoSuchMethodError();
@@ -465,7 +465,7 @@ public abstract class Serializer extends BeanContext {
private final MediaType produces;
// Hidden constructors to force subclass from OuputStreamSerializer or WriterSerializer.
- Serializer(PropertyStore2 ps, String produces, String...accept) {
+ Serializer(PropertyStore ps, String produces, String...accept) {
super(ps);
maxDepth = getProperty(SERIALIZER_maxDepth, Integer.class, 100);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
index a0cbde0..78a60b0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
@@ -37,7 +37,7 @@ public class SerializerBuilder extends BeanContextBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public SerializerBuilder(PropertyStore2 ps) {
+ public SerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -893,7 +893,7 @@ public class SerializerBuilder extends BeanContextBuilder {
}
@Override /* ContextBuilder */
- public SerializerBuilder apply(PropertyStore2 copyFrom) {
+ public SerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroup.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
index da475d9..f1239e0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
@@ -70,7 +70,7 @@ public final class SerializerGroup {
private final List<MediaType> mediaTypesList;
private final Serializer[] mediaTypeSerializers;
private final List<Serializer> serializers;
- private final PropertyStore2 propertyStore;
+ private final PropertyStore propertyStore;
/**
* Instantiates a new clean-slate {@link SerializerGroupBuilder} object.
@@ -104,7 +104,7 @@ public final class SerializerGroup {
* The order is important because they will be tried in reverse order (e.g.newer first) in which they will be tried
* to match against media types.
*/
- public SerializerGroup(PropertyStore2 ps, Serializer[] serializers) {
+ public SerializerGroup(PropertyStore ps, Serializer[] serializers) {
this.propertyStore = ps;
this.serializers = Collections.unmodifiableList(new ArrayList<>(Arrays.asList(serializers)));
@@ -253,7 +253,7 @@ public final class SerializerGroup {
*
* @return A new copy of the property store passed in to the constructor.
*/
- public PropertyStore2 getPropertyStore() {
+ public PropertyStore getPropertyStore() {
return propertyStore;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
index 33b4ab0..37cd078 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
@@ -35,7 +35,7 @@ public class SerializerGroupBuilder {
*/
public SerializerGroupBuilder() {
this.serializers = new ArrayList<>();
- this.propertyStore = PropertyStore2.create();
+ this.propertyStore = PropertyStore.create();
}
/**
@@ -108,7 +108,7 @@ public class SerializerGroupBuilder {
List<Serializer> l = new ArrayList<>();
for (Object s : serializers) {
Class<? extends Serializer> c = null;
- PropertyStore2 ps = propertyStore.build();
+ PropertyStore ps = propertyStore.build();
if (s instanceof Class) {
c = (Class<? extends Serializer>)s;
} else {
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
index d96a9cc..4863b29 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
@@ -41,7 +41,7 @@ public abstract class WriterSerializer extends Serializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- protected WriterSerializer(PropertyStore2 ps, String produces, String...accept) {
+ protected WriterSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
index a38ca6a..a9b320c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
@@ -61,7 +61,7 @@ public final class SoapXmlSerializer extends XmlSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public SoapXmlSerializer(PropertyStore2 ps) {
+ public SoapXmlSerializer(PropertyStore ps) {
super(ps, "text/xml", "text/xml+soap");
soapAction = getProperty(SOAPXML_SOAPAction, String.class, "http://www.w3.org/2003/05/soap-envelope");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
index a1b7ebc..d95558d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
@@ -38,7 +38,7 @@ public class SoapXmlSerializerBuilder extends XmlSerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public SoapXmlSerializerBuilder(PropertyStore2 ps) {
+ public SoapXmlSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -628,7 +628,7 @@ public class SoapXmlSerializerBuilder extends XmlSerializerBuilder {
}
@Override /* ContextBuilder */
- public SoapXmlSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public SoapXmlSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
index 20dadf3..14752f5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
@@ -57,10 +57,10 @@ public class UonParser extends ReaderParser {
//-------------------------------------------------------------------------------------------------------------------
/** Reusable instance of {@link UonParser}, all default settings. */
- public static final UonParser DEFAULT = new UonParser(PropertyStore2.DEFAULT);
+ public static final UonParser DEFAULT = new UonParser(PropertyStore.DEFAULT);
/** Reusable instance of {@link UonParser} with decodeChars set to true. */
- public static final UonParser DEFAULT_DECODING = new UonParser.Decoding(PropertyStore2.DEFAULT);
+ public static final UonParser DEFAULT_DECODING = new UonParser.Decoding(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -75,7 +75,7 @@ public class UonParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public Decoding(PropertyStore2 ps) {
+ public Decoding(PropertyStore ps) {
super(ps.builder().set(UON_decodeChars, true).build());
}
}
@@ -94,7 +94,7 @@ public class UonParser extends ReaderParser {
* @param ps
* The property store containing all the settings for this object.
*/
- public UonParser(PropertyStore2 ps) {
+ public UonParser(PropertyStore ps) {
this(ps, "text/uon");
}
@@ -106,7 +106,7 @@ public class UonParser extends ReaderParser {
* @param consumes
* The list of media types that this parser consumes (e.g. <js>"application/json"</js>, <js>"*​/json"</js>).
*/
- public UonParser(PropertyStore2 ps, String...consumes) {
+ public UonParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
this.decodeChars = getProperty(UON_decodeChars, boolean.class, false);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParserBuilder.java
index c89df95..f6ec15f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParserBuilder.java
@@ -37,7 +37,7 @@ public class UonParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public UonParserBuilder(PropertyStore2 ps) {
+ public UonParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -483,7 +483,7 @@ public class UonParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public UonParserBuilder apply(PropertyStore2 copyFrom) {
+ public UonParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
index c1b02e3..6d921c9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
@@ -186,13 +186,13 @@ public class UonSerializer extends WriterSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Reusable instance of {@link UonSerializer}, all default settings. */
- public static final UonSerializer DEFAULT = new UonSerializer(PropertyStore2.DEFAULT);
+ public static final UonSerializer DEFAULT = new UonSerializer(PropertyStore.DEFAULT);
/** Reusable instance of {@link UonSerializer.Readable}. */
- public static final UonSerializer DEFAULT_READABLE = new Readable(PropertyStore2.DEFAULT);
+ public static final UonSerializer DEFAULT_READABLE = new Readable(PropertyStore.DEFAULT);
/** Reusable instance of {@link UonSerializer.Encoding}. */
- public static final UonSerializer DEFAULT_ENCODING = new Encoding(PropertyStore2.DEFAULT);
+ public static final UonSerializer DEFAULT_ENCODING = new Encoding(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -209,7 +209,7 @@ public class UonSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Readable(PropertyStore2 ps) {
+ public Readable(PropertyStore ps) {
super(ps.builder().set(SERIALIZER_useWhitespace, true).build());
}
}
@@ -224,7 +224,7 @@ public class UonSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Encoding(PropertyStore2 ps) {
+ public Encoding(PropertyStore ps) {
super(ps.builder().set(UON_encodeChars, true).build());
}
}
@@ -247,7 +247,7 @@ public class UonSerializer extends WriterSerializer {
* @param ps
* The property store containing all the settings for this object.
*/
- public UonSerializer(PropertyStore2 ps) {
+ public UonSerializer(PropertyStore ps) {
this(ps, "text/uon");
}
@@ -272,7 +272,7 @@ public class UonSerializer extends WriterSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public UonSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public UonSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
encodeChars = getProperty(UON_encodeChars, boolean.class, false);
addBeanTypeProperties = getProperty(UON_addBeanTypeProperties, boolean.class, getProperty(SERIALIZER_addBeanTypeProperties, boolean.class, true));
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
index bce3cec..39c3326 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
@@ -37,7 +37,7 @@ public class UonSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public UonSerializerBuilder(PropertyStore2 ps) {
+ public UonSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -633,7 +633,7 @@ public class UonSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public UonSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public UonSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index 3e19f46..b45e4ae 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -71,7 +71,7 @@ public class UrlEncodingParser extends UonParser implements PartParser {
//-------------------------------------------------------------------------------------------------------------------
/** Reusable instance of {@link UrlEncodingParser}. */
- public static final UrlEncodingParser DEFAULT = new UrlEncodingParser(PropertyStore2.DEFAULT);
+ public static final UrlEncodingParser DEFAULT = new UrlEncodingParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -86,7 +86,7 @@ public class UrlEncodingParser extends UonParser implements PartParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public UrlEncodingParser(PropertyStore2 ps) {
+ public UrlEncodingParser(PropertyStore ps) {
super(
ps.builder()
.set(UON_decodeChars, true)
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserBuilder.java
index c421682..4f201d8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserBuilder.java
@@ -39,7 +39,7 @@ public class UrlEncodingParserBuilder extends UonParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public UrlEncodingParserBuilder(PropertyStore2 ps) {
+ public UrlEncodingParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -505,7 +505,7 @@ public class UrlEncodingParserBuilder extends UonParserBuilder {
}
@Override /* ContextBuilder */
- public UrlEncodingParserBuilder apply(PropertyStore2 copyFrom) {
+ public UrlEncodingParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index 0236053..7d88220 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -162,16 +162,16 @@ public class UrlEncodingSerializer extends UonSerializer implements PartSerializ
//-------------------------------------------------------------------------------------------------------------------
/** Reusable instance of {@link UrlEncodingSerializer}, all default settings. */
- public static final UrlEncodingSerializer DEFAULT = new UrlEncodingSerializer(PropertyStore2.DEFAULT);
+ public static final UrlEncodingSerializer DEFAULT = new UrlEncodingSerializer(PropertyStore.DEFAULT);
/** Reusable instance of {@link UrlEncodingSerializer.PlainText}. */
- public static final UrlEncodingSerializer DEFAULT_PLAINTEXT = new PlainText(PropertyStore2.DEFAULT);
+ public static final UrlEncodingSerializer DEFAULT_PLAINTEXT = new PlainText(PropertyStore.DEFAULT);
/** Reusable instance of {@link UrlEncodingSerializer.Expanded}. */
- public static final UrlEncodingSerializer DEFAULT_EXPANDED = new Expanded(PropertyStore2.DEFAULT);
+ public static final UrlEncodingSerializer DEFAULT_EXPANDED = new Expanded(PropertyStore.DEFAULT);
/** Reusable instance of {@link UrlEncodingSerializer.Readable}. */
- public static final UrlEncodingSerializer DEFAULT_READABLE = new Readable(PropertyStore2.DEFAULT);
+ public static final UrlEncodingSerializer DEFAULT_READABLE = new Readable(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -188,7 +188,7 @@ public class UrlEncodingSerializer extends UonSerializer implements PartSerializ
*
* @param ps The property store containing all the settings for this object.
*/
- public Expanded(PropertyStore2 ps) {
+ public Expanded(PropertyStore ps) {
super(ps.builder().set(URLENC_expandedParams, true).build());
}
}
@@ -203,7 +203,7 @@ public class UrlEncodingSerializer extends UonSerializer implements PartSerializ
*
* @param ps The property store containing all the settings for this object.
*/
- public Readable(PropertyStore2 ps) {
+ public Readable(PropertyStore ps) {
super(ps.builder().set(SERIALIZER_useWhitespace, true).build());
}
}
@@ -218,7 +218,7 @@ public class UrlEncodingSerializer extends UonSerializer implements PartSerializ
*
* @param ps The property store containing all the settings for this object.
*/
- public PlainText(PropertyStore2 ps) {
+ public PlainText(PropertyStore ps) {
super(ps.builder().set(UON_paramFormat, "PLAINTEXT").build());
}
}
@@ -237,7 +237,7 @@ public class UrlEncodingSerializer extends UonSerializer implements PartSerializ
* @param ps
* The property store containing all the settings for this object.
*/
- public UrlEncodingSerializer(PropertyStore2 ps) {
+ public UrlEncodingSerializer(PropertyStore ps) {
this(ps, "application/x-www-form-urlencoded");
}
@@ -262,7 +262,7 @@ public class UrlEncodingSerializer extends UonSerializer implements PartSerializ
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public UrlEncodingSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public UrlEncodingSerializer(PropertyStore ps, String produces, String...accept) {
super(
ps.builder()
.set(UON_encodeChars, true)
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
index 9cad52b..1c8b28a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
@@ -38,7 +38,7 @@ public class UrlEncodingSerializerBuilder extends UonSerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public UrlEncodingSerializerBuilder(PropertyStore2 ps) {
+ public UrlEncodingSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -671,7 +671,7 @@ public class UrlEncodingSerializerBuilder extends UonSerializerBuilder {
}
@Override /* ContextBuilder */
- public UrlEncodingSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public UrlEncodingSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
index 4dfe1d7..a47849e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
@@ -45,7 +45,7 @@ public class XmlDocSerializer extends XmlSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Ns(PropertyStore2 ps) {
+ public Ns(PropertyStore ps) {
super(ps.builder().set(XML_enableNamespaces, true).build());
}
}
@@ -60,7 +60,7 @@ public class XmlDocSerializer extends XmlSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public XmlDocSerializer(PropertyStore2 ps) {
+ public XmlDocSerializer(PropertyStore ps) {
super(ps);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
index 6607543..7e47c3c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -140,7 +140,7 @@ public class XmlParser extends ReaderParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final XmlParser DEFAULT = new XmlParser(PropertyStore2.DEFAULT);
+ public static final XmlParser DEFAULT = new XmlParser(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -160,7 +160,7 @@ public class XmlParser extends ReaderParser {
* @param ps
* The property store containing all the settings for this object.
*/
- public XmlParser(PropertyStore2 ps) {
+ public XmlParser(PropertyStore ps) {
this(ps, "text/xml", "application/xml");
}
@@ -172,7 +172,7 @@ public class XmlParser extends ReaderParser {
* @param consumes
* The list of media types that this parser consumes (e.g. <js>"application/json"</js>, <js>"*​/json"</js>).
*/
- public XmlParser(PropertyStore2 ps, String...consumes) {
+ public XmlParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
validating = getProperty(XML_validating, boolean.class, false);
preserveRootElement = getProperty(XML_preserveRootElement, boolean.class, false);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParserBuilder.java
index 367c4d8..18db005 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParserBuilder.java
@@ -40,7 +40,7 @@ public class XmlParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public XmlParserBuilder(PropertyStore2 ps) {
+ public XmlParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -589,7 +589,7 @@ public class XmlParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public XmlParserBuilder apply(PropertyStore2 copyFrom) {
+ public XmlParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
index f824974..233aa79 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaDocSerializer.java
@@ -41,7 +41,7 @@ public class XmlSchemaDocSerializer extends XmlSchemaSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public XmlSchemaDocSerializer(PropertyStore2 ps) {
+ public XmlSchemaDocSerializer(PropertyStore ps) {
super(ps);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
index c86dfe1..be2b2af 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
@@ -36,7 +36,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
*
* @param ps Initialize with the specified config property store.
*/
- public XmlSchemaSerializer(PropertyStore2 ps) {
+ public XmlSchemaSerializer(PropertyStore ps) {
super(
ps.builder()
.set(XML_enableNamespaces, true)
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializerBuilder.java
index 63056bc..ce26832 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSchemaSerializerBuilder.java
@@ -35,7 +35,7 @@ public class XmlSchemaSerializerBuilder extends XmlSerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public XmlSchemaSerializerBuilder(PropertyStore2 ps) {
+ public XmlSchemaSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -614,7 +614,7 @@ public class XmlSchemaSerializerBuilder extends XmlSerializerBuilder {
}
@Override /* ContextBuilder */
- public XmlSchemaSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public XmlSchemaSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index e7e6f9d..c1f6c2c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -258,22 +258,22 @@ public class XmlSerializer extends WriterSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer without namespaces. */
- public static final XmlSerializer DEFAULT = new XmlSerializer(PropertyStore2.DEFAULT);
+ public static final XmlSerializer DEFAULT = new XmlSerializer(PropertyStore.DEFAULT);
/** Default serializer without namespaces, with single quotes. */
- public static final XmlSerializer DEFAULT_SQ = new Sq(PropertyStore2.DEFAULT);
+ public static final XmlSerializer DEFAULT_SQ = new Sq(PropertyStore.DEFAULT);
/** Default serializer without namespaces, with single quotes, whitespace added. */
- public static final XmlSerializer DEFAULT_SQ_READABLE = new SqReadable(PropertyStore2.DEFAULT);
+ public static final XmlSerializer DEFAULT_SQ_READABLE = new SqReadable(PropertyStore.DEFAULT);
/** Default serializer, all default settings. */
- public static final XmlSerializer DEFAULT_NS = new Ns(PropertyStore2.DEFAULT);
+ public static final XmlSerializer DEFAULT_NS = new Ns(PropertyStore.DEFAULT);
/** Default serializer, single quotes. */
- public static final XmlSerializer DEFAULT_NS_SQ = new NsSq(PropertyStore2.DEFAULT);
+ public static final XmlSerializer DEFAULT_NS_SQ = new NsSq(PropertyStore.DEFAULT);
/** Default serializer, single quotes, whitespace added. */
- public static final XmlSerializer DEFAULT_NS_SQ_READABLE = new NsSqReadable(PropertyStore2.DEFAULT);
+ public static final XmlSerializer DEFAULT_NS_SQ_READABLE = new NsSqReadable(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -288,7 +288,7 @@ public class XmlSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Sq(PropertyStore2 ps) {
+ public Sq(PropertyStore ps) {
super(
ps.builder()
.set(SERIALIZER_quoteChar, '\'')
@@ -305,7 +305,7 @@ public class XmlSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public SqReadable(PropertyStore2 ps) {
+ public SqReadable(PropertyStore ps) {
super(
ps.builder()
.set(SERIALIZER_quoteChar, '\'')
@@ -323,7 +323,7 @@ public class XmlSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public Ns(PropertyStore2 ps) {
+ public Ns(PropertyStore ps) {
super(
ps.builder()
.set(XML_enableNamespaces, true)
@@ -342,7 +342,7 @@ public class XmlSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public NsSq(PropertyStore2 ps) {
+ public NsSq(PropertyStore ps) {
super(
ps.builder()
.set(XML_enableNamespaces, true)
@@ -360,7 +360,7 @@ public class XmlSerializer extends WriterSerializer {
*
* @param ps The property store containing all the settings for this object.
*/
- public NsSqReadable(PropertyStore2 ps) {
+ public NsSqReadable(PropertyStore ps) {
super(
ps.builder()
.set(XML_enableNamespaces, true)
@@ -400,7 +400,7 @@ public class XmlSerializer extends WriterSerializer {
* @param ps
* The property store containing all the settings for this object.
*/
- public XmlSerializer(PropertyStore2 ps) {
+ public XmlSerializer(PropertyStore ps) {
this(ps, "text/xml");
}
@@ -425,7 +425,7 @@ public class XmlSerializer extends WriterSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public XmlSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public XmlSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
autoDetectNamespaces = getProperty(XML_autoDetectNamespaces, boolean.class, true);
enableNamespaces = getProperty(XML_enableNamespaces, boolean.class, false);
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
index 997afc3..b3ab67f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
@@ -37,7 +37,7 @@ public class XmlSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public XmlSerializerBuilder(PropertyStore2 ps) {
+ public XmlSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -731,7 +731,7 @@ public class XmlSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public XmlSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public XmlSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParser.java
index 896a166..42a8ce4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParser.java
@@ -51,7 +51,7 @@ import org.apache.juneau.parser.*;
* JSON objects (<js>"{...}"</js>) are converted to {@link ObjectMap ObjectMaps}.
* <b>Note:</b> If a <code><xa>_type</xa>=<xs>'xxx'</xs></code> attribute is specified on the object, then an
* attempt is made to convert the object to an instance of the specified Java bean class.
- * See the <code>beanTypeName</code> setting on the {@link PropertyStore2} for more information about parsing
+ * See the <code>beanTypeName</code> setting on the {@link PropertyStore} for more information about parsing
* beans from JSON.
* <li>
* JSON arrays (<js>"[...]"</js>) are converted to {@link ObjectList ObjectLists}.
@@ -105,10 +105,10 @@ public class YamlParser extends ReaderParser {
//-------------------------------------------------------------------------------------------------------------------
/** Default parser, all default settings.*/
- public static final YamlParser DEFAULT = new YamlParser(PropertyStore2.DEFAULT);
+ public static final YamlParser DEFAULT = new YamlParser(PropertyStore.DEFAULT);
/** Default parser, all default settings.*/
- public static final YamlParser DEFAULT_STRICT = new YamlParser.Strict(PropertyStore2.DEFAULT);
+ public static final YamlParser DEFAULT_STRICT = new YamlParser.Strict(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -123,7 +123,7 @@ public class YamlParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public Strict(PropertyStore2 ps) {
+ public Strict(PropertyStore ps) {
super(ps.builder().set(PARSER_strict, true).build());
}
}
@@ -138,7 +138,7 @@ public class YamlParser extends ReaderParser {
*
* @param ps The property store containing all the settings for this object.
*/
- public YamlParser(PropertyStore2 ps) {
+ public YamlParser(PropertyStore ps) {
this(ps, "application/json", "text/json");
}
@@ -148,7 +148,7 @@ public class YamlParser extends ReaderParser {
* @param ps The property store containing all the settings for this object.
* @param consumes The list of media types that this parser consumes (e.g. <js>"application/json"</js>).
*/
- public YamlParser(PropertyStore2 ps, String...consumes) {
+ public YamlParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParserBuilder.java
index 9cf26b4..b005ce9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlParserBuilder.java
@@ -35,7 +35,7 @@ public class YamlParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public YamlParserBuilder(PropertyStore2 ps) {
+ public YamlParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -452,7 +452,7 @@ public class YamlParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public YamlParserBuilder apply(PropertyStore2 copyFrom) {
+ public YamlParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
index 279b369..f91bb0f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
@@ -147,7 +147,7 @@ public class YamlSerializer extends WriterSerializer {
//-------------------------------------------------------------------------------------------------------------------
/** Default serializer, all default settings.*/
- public static final YamlSerializer DEFAULT = new YamlSerializer(PropertyStore2.DEFAULT);
+ public static final YamlSerializer DEFAULT = new YamlSerializer(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -165,7 +165,7 @@ public class YamlSerializer extends WriterSerializer {
* @param ps
* The property store containing all the settings for this object.
*/
- public YamlSerializer(PropertyStore2 ps) {
+ public YamlSerializer(PropertyStore ps) {
this(ps, "application/yaml", "application/yaml", "application/yaml+*", "text/yaml", "text/yaml+*");
}
@@ -190,7 +190,7 @@ public class YamlSerializer extends WriterSerializer {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public YamlSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public YamlSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
simpleMode = getProperty(YAML_simpleMode, boolean.class, false);
escapeSolidus = getProperty(YAML_escapeSolidus, boolean.class, false);
[4/4] juneau git commit: (JUNEAU-76) Improvements to Context/Builder
APIs
Posted by ja...@apache.org.
(JUNEAU-76) Improvements to Context/Builder APIs
Rename PropertyStore2 to PropertyStore.
Project: http://git-wip-us.apache.org/repos/asf/juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/juneau/commit/b49b9192
Tree: http://git-wip-us.apache.org/repos/asf/juneau/tree/b49b9192
Diff: http://git-wip-us.apache.org/repos/asf/juneau/diff/b49b9192
Branch: refs/heads/master
Commit: b49b91926406ea9f2bd59253efa3768b083ad260
Parents: e2b108f
Author: JamesBognar <ja...@apache.org>
Authored: Sat Dec 23 12:10:15 2017 -0500
Committer: JamesBognar <ja...@apache.org>
Committed: Sat Dec 23 12:10:15 2017 -0500
----------------------------------------------------------------------
.../apache/juneau/ini/ConfigFileContext.java | 2 +-
.../org/apache/juneau/ContextCacheTest.java | 18 +-
.../org/apache/juneau/PropertyStore2Test.java | 198 +--
.../org/apache/juneau/XmlValidatorParser.java | 2 +-
.../juneau/XmlValidatorParserBuilder.java | 2 +-
.../apache/juneau/parser/ParserGroupTest.java | 16 +-
.../juneau/serializer/SerializerGroupTest.java | 22 +-
.../java/org/apache/juneau/jena/RdfParser.java | 20 +-
.../apache/juneau/jena/RdfParserBuilder.java | 4 +-
.../org/apache/juneau/jena/RdfSerializer.java | 24 +-
.../juneau/jena/RdfSerializerBuilder.java | 4 +-
.../java/org/apache/juneau/BeanContext.java | 2 +-
.../org/apache/juneau/BeanContextBuilder.java | 4 +-
.../main/java/org/apache/juneau/Context.java | 12 +-
.../java/org/apache/juneau/ContextBuilder.java | 6 +-
.../java/org/apache/juneau/ContextCache.java | 8 +-
.../java/org/apache/juneau/PropertyStore.java | 748 +++++++++++
.../java/org/apache/juneau/PropertyStore2.java | 748 -----------
.../org/apache/juneau/PropertyStoreBuilder.java | 22 +-
.../org/apache/juneau/PropertyStoreOld.java | 1254 ------------------
.../java/org/apache/juneau/PropertyType.java | 2 +-
.../java/org/apache/juneau/csv/CsvParser.java | 4 +-
.../org/apache/juneau/csv/CsvParserBuilder.java | 4 +-
.../org/apache/juneau/csv/CsvSerializer.java | 4 +-
.../apache/juneau/csv/CsvSerializerBuilder.java | 4 +-
.../apache/juneau/html/HtmlDocSerializer.java | 6 +-
.../java/org/apache/juneau/html/HtmlParser.java | 4 +-
.../apache/juneau/html/HtmlParserBuilder.java | 4 +-
.../juneau/html/HtmlSchemaDocSerializer.java | 4 +-
.../org/apache/juneau/html/HtmlSerializer.java | 14 +-
.../juneau/html/HtmlSerializerBuilder.java | 4 +-
.../juneau/html/HtmlStrippedDocSerializer.java | 4 +-
.../java/org/apache/juneau/jso/JsoParser.java | 4 +-
.../org/apache/juneau/jso/JsoParserBuilder.java | 4 +-
.../org/apache/juneau/jso/JsoSerializer.java | 4 +-
.../apache/juneau/jso/JsoSerializerBuilder.java | 4 +-
.../java/org/apache/juneau/json/JsonParser.java | 12 +-
.../apache/juneau/json/JsonParserBuilder.java | 4 +-
.../juneau/json/JsonSchemaSerializer.java | 2 +-
.../json/JsonSchemaSerializerBuilder.java | 4 +-
.../org/apache/juneau/json/JsonSerializer.java | 22 +-
.../juneau/json/JsonSerializerBuilder.java | 4 +-
.../apache/juneau/msgpack/MsgPackParser.java | 4 +-
.../juneau/msgpack/MsgPackParserBuilder.java | 4 +-
.../juneau/msgpack/MsgPackSerializer.java | 4 +-
.../msgpack/MsgPackSerializerBuilder.java | 4 +-
.../apache/juneau/parser/InputStreamParser.java | 2 +-
.../java/org/apache/juneau/parser/Parser.java | 4 +-
.../org/apache/juneau/parser/ParserBuilder.java | 4 +-
.../org/apache/juneau/parser/ParserGroup.java | 6 +-
.../juneau/parser/ParserGroupBuilder.java | 4 +-
.../org/apache/juneau/parser/ReaderParser.java | 2 +-
.../juneau/plaintext/PlainTextParser.java | 6 +-
.../plaintext/PlainTextParserBuilder.java | 4 +-
.../juneau/plaintext/PlainTextSerializer.java | 6 +-
.../plaintext/PlainTextSerializerBuilder.java | 4 +-
.../serializer/OutputStreamSerializer.java | 2 +-
.../apache/juneau/serializer/Serializer.java | 4 +-
.../juneau/serializer/SerializerBuilder.java | 4 +-
.../juneau/serializer/SerializerGroup.java | 6 +-
.../serializer/SerializerGroupBuilder.java | 4 +-
.../juneau/serializer/WriterSerializer.java | 2 +-
.../apache/juneau/soap/SoapXmlSerializer.java | 2 +-
.../juneau/soap/SoapXmlSerializerBuilder.java | 4 +-
.../java/org/apache/juneau/uon/UonParser.java | 10 +-
.../org/apache/juneau/uon/UonParserBuilder.java | 4 +-
.../org/apache/juneau/uon/UonSerializer.java | 14 +-
.../apache/juneau/uon/UonSerializerBuilder.java | 4 +-
.../juneau/urlencoding/UrlEncodingParser.java | 4 +-
.../urlencoding/UrlEncodingParserBuilder.java | 4 +-
.../urlencoding/UrlEncodingSerializer.java | 18 +-
.../UrlEncodingSerializerBuilder.java | 4 +-
.../org/apache/juneau/xml/XmlDocSerializer.java | 4 +-
.../java/org/apache/juneau/xml/XmlParser.java | 6 +-
.../org/apache/juneau/xml/XmlParserBuilder.java | 4 +-
.../juneau/xml/XmlSchemaDocSerializer.java | 2 +-
.../apache/juneau/xml/XmlSchemaSerializer.java | 2 +-
.../juneau/xml/XmlSchemaSerializerBuilder.java | 4 +-
.../org/apache/juneau/xml/XmlSerializer.java | 26 +-
.../apache/juneau/xml/XmlSerializerBuilder.java | 4 +-
.../apache/juneau/yaml/proto/YamlParser.java | 12 +-
.../juneau/yaml/proto/YamlParserBuilder.java | 4 +-
.../juneau/yaml/proto/YamlSerializer.java | 6 +-
.../yaml/proto/YamlSerializerBuilder.java | 4 +-
.../apache/juneau/rest/client/RestClient.java | 2 +-
.../juneau/rest/client/RestClientBuilder.java | 4 +-
.../java/org/apache/juneau/rest/RestConfig.java | 4 +-
.../org/apache/juneau/rest/RestContext.java | 4 +-
88 files changed, 1112 insertions(+), 2366 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileContext.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileContext.java
index 6684f0a..0484909 100644
--- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileContext.java
+++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileContext.java
@@ -24,7 +24,7 @@ public class ConfigFileContext extends Context {
*
* @param ps
*/
- public ConfigFileContext(PropertyStore2 ps) {
+ public ConfigFileContext(PropertyStore ps) {
super(ps);
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ContextCacheTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ContextCacheTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ContextCacheTest.java
index 4da824b..4c9ad36 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ContextCacheTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/ContextCacheTest.java
@@ -29,8 +29,8 @@ public class ContextCacheTest {
@Test
public void testBasic() {
- PropertyStoreBuilder psb = PropertyStore2.create();
- PropertyStore2 ps = psb.build();
+ PropertyStoreBuilder psb = PropertyStore.create();
+ PropertyStore ps = psb.build();
A a = ContextCache.INSTANCE.create(A.class, ps);
B b = ContextCache.INSTANCE.create(B.class, ps);
@@ -126,7 +126,7 @@ public class ContextCacheTest {
public static class A extends Context {
public final String f1;
- public A(PropertyStore2 ps) {
+ public A(PropertyStore ps) {
super(ps);
f1 = getProperty("A.f1", String.class, "xxx");
}
@@ -145,7 +145,7 @@ public class ContextCacheTest {
public static class B extends A {
public int f2;
- public B(PropertyStore2 ps) {
+ public B(PropertyStore ps) {
super(ps);
f2 = getProperty("B.f2.i", Integer.class, -1);
@@ -154,7 +154,7 @@ public class ContextCacheTest {
public static class C extends B {
public boolean f3;
- public C(PropertyStore2 ps) {
+ public C(PropertyStore ps) {
super(ps);
f3 = getProperty("C.f3.b", boolean.class, false);
}
@@ -162,8 +162,8 @@ public class ContextCacheTest {
@Test
public void testBadConstructor() {
- PropertyStoreBuilder psb = PropertyStore2.create();
- PropertyStore2 ps = psb.build();
+ PropertyStoreBuilder psb = PropertyStore.create();
+ PropertyStore ps = psb.build();
try {
ContextCache.INSTANCE.create(D1.class, ps);
@@ -180,13 +180,13 @@ public class ContextCacheTest {
}
public static class D1 extends A {
- protected D1(PropertyStore2 ps) {
+ protected D1(PropertyStore ps) {
super(ps);
}
}
public static class D2 extends A {
- public D2(PropertyStore2 ps) {
+ public D2(PropertyStore ps) {
super(ps);
throw new RuntimeException("Error!");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/PropertyStore2Test.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/PropertyStore2Test.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/PropertyStore2Test.java
index 88f3f12..a62fa1b 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/PropertyStore2Test.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/PropertyStore2Test.java
@@ -32,7 +32,7 @@ public class PropertyStore2Test {
@Test
public void testBasic() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set("B.f4.s", "4");
b.set("B.f3.s", "3");
@@ -48,7 +48,7 @@ public class PropertyStore2Test {
@Test
public void testInvalidKeys() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
testError(b, "A.f1/add", "foo", "Cannot add value 'foo' (String) to property 'f1' (String).");
testError(b, "A.f1/add.123", "foo", "Cannot add value 'foo' (String) to property 'f1' (String).");
testError(b, "A.f1/remove", "foo", "Cannot remove value 'foo' (String) from property 'f1' (String).");
@@ -63,8 +63,8 @@ public class PropertyStore2Test {
@Test
public void testString() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.s", "1");
b.set("A.f2.s", 2);
b.set("A.f3.s", true);
@@ -109,8 +109,8 @@ public class PropertyStore2Test {
@Test
public void testBoolean() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.b", "true");
b.set("A.f2.b", "false");
b.set("A.f3.b", new StringBuilder("true"));
@@ -137,8 +137,8 @@ public class PropertyStore2Test {
@Test
public void testInteger() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.i", 123);
b.set("A.f2.i", "123");
b.set("A.f3.i", new StringBuilder("123"));
@@ -166,8 +166,8 @@ public class PropertyStore2Test {
@Test
public void testClass() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.c", String.class);
b.set("A.f2.c", Integer.class);
b.set("A.f3.c", null);
@@ -189,8 +189,8 @@ public class PropertyStore2Test {
@Test
public void testObject() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.o", 123);
b.set("A.f2.o", true);
b.set("A.f3.o", new StringBuilder("123"));
@@ -222,8 +222,8 @@ public class PropertyStore2Test {
@Test
public void testSetString() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.ss", new AList<String>().appendAll("foo", "bar", "bar", null));
b.set("A.f2.ss", new AList<Object>().appendAll(123, true, TestEnum.ONE, TestEnum.ONE, null));
b.set("A.f3.ss", new AList<StringBuilder>().appendAll(new StringBuilder("foo"), null));
@@ -286,8 +286,8 @@ public class PropertyStore2Test {
@Test
public void testSetInteger() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.si", new AList<Integer>().appendAll(3, 2, 1, null));
b.set("A.f2.si", new AList<Object>().appendAll(123, "456", null));
b.set("A.f3.si", new AList<StringBuilder>().appendAll(new StringBuilder("123"), null));
@@ -380,8 +380,8 @@ public class PropertyStore2Test {
@Test
public void testSetClass() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.sc", new AList<Class<?>>().appendAll(String.class, Integer.class, null));
b.set("A.f2.sc", new AList<Object>().appendAll(String.class, Integer.class, null));
b.set("A.f3.sc", null);
@@ -446,8 +446,8 @@ public class PropertyStore2Test {
@Test
public void testListString() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.ls", new AList<String>().appendAll("foo", "bar", "bar", null));
b.set("A.f2.ls", new AList<Object>().appendAll(123, true, TestEnum.ONE, TestEnum.ONE, null));
b.set("A.f3.ls", new AList<StringBuilder>().appendAll(new StringBuilder("foo"), null));
@@ -520,8 +520,8 @@ public class PropertyStore2Test {
@Test
public void testListInteger() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.li", new AList<Integer>().appendAll(1, 2, 3, null));
b.set("A.f2.li", new AList<Object>().appendAll(123, "456", null));
b.set("A.f3.li", new AList<StringBuilder>().appendAll(new StringBuilder("123"), null));
@@ -624,8 +624,8 @@ public class PropertyStore2Test {
@Test
public void testListClass() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.lc", new AList<Class<?>>().appendAll(String.class, Integer.class, null));
b.set("A.f2.lc", new AList<Object>().appendAll(String.class, Integer.class, null));
b.set("A.f3.lc", null);
@@ -697,8 +697,8 @@ public class PropertyStore2Test {
@Test
public void testListObject() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.lo", new AList<Class<?>>().appendAll(StringBuilder.class, null));
b.set("A.f2.lo", new AList<Object>().appendAll(123, true, new StringBuilder(123), StringBuilder.class, null));
b.set("A.f3.lo", null);
@@ -770,8 +770,8 @@ public class PropertyStore2Test {
@Test
public void testMapString() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.ms", new AMap<String,String>().append("foo", "bar").append("baz", "qux").append("quux", null).append(null, null));
b.set("A.f2.ms", new AMap<String,Object>().append("foo", 123).append("bar", true).append("baz", TestEnum.ONE).append("qux", null));
b.set("A.f3.ms", new AMap<String,StringBuilder>().append("foo", new StringBuilder("bar")).append("baz", null));
@@ -811,8 +811,8 @@ public class PropertyStore2Test {
@Test
public void testMapInteger() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.mi", new AMap<String,String>().append("foo", "1").append("baz", "2").append("quux", null).append(null, null));
b.set("A.f2.mi", new AMap<String,Object>().append("foo", 123).append("bar", "456").append("baz", null));
b.set("A.f3.mi", new AMap<String,StringBuilder>().append("foo", new StringBuilder("123")).append("baz", null));
@@ -852,8 +852,8 @@ public class PropertyStore2Test {
@Test
public void testMapClass() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = null;
b.set("A.f1.mc", new AMap<String,Class<?>>().append("foo", String.class).append("baz", Integer.class).append("quux", null).append(null, null));
b.set("A.f2.mc", new AMap<String,Object>().append("foo", String.class).append("bar", Integer.class).append("baz", null));
b.set("A.f3.mc", null);
@@ -887,9 +887,9 @@ public class PropertyStore2Test {
@Test
public void testMapObject() throws Exception {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
- PropertyStore2 ps = null;
+ PropertyStore ps = null;
b.set("A.f1.mo", new AMap<String,String>().append("foo", "1").append("baz", "2").append("quux", null).append(null, null));
b.set("A.f2.mo", new AMap<String,Object>().append("foo", 123).append("bar", StringBuilder.class).append("qux", null));
b.set("A.f3.mo", new AMap<String,StringBuilder>().append("foo", new StringBuilder("123")).append("baz", null));
@@ -933,8 +933,8 @@ public class PropertyStore2Test {
@Test
public void testPropertyTypeStringHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1", "foo");
b2.set("A.f1", new StringBuilder("foo"));
@@ -960,8 +960,8 @@ public class PropertyStore2Test {
@Test
public void testPropertyTypeBooleanHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.b", true);
b2.set("A.f1.b", new StringBuilder("true"));
@@ -987,8 +987,8 @@ public class PropertyStore2Test {
@Test
public void testPropertyTypeIntegerHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.i", 1);
b2.set("A.f1.i", new StringBuilder("1"));
@@ -1016,8 +1016,8 @@ public class PropertyStore2Test {
@Test
public void testClassHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.c", String.class);
b2.set("A.f1.c", String.class);
@@ -1044,8 +1044,8 @@ public class PropertyStore2Test {
@Test
public void testObjectHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.o", "foo");
b2.set("A.f1.o", "foo");
@@ -1071,8 +1071,8 @@ public class PropertyStore2Test {
@Test
public void testSetStringHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.ss", new AList<String>().appendAll("foo", "bar"));
b2.set("A.f1.ss", new String[]{"foo","bar"});
@@ -1102,8 +1102,8 @@ public class PropertyStore2Test {
@Test
public void testSetIntegerHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.si", new AList<String>().appendAll("1", "2"));
b2.set("A.f1.si", new String[]{"1","2"});
@@ -1133,8 +1133,8 @@ public class PropertyStore2Test {
@Test
public void testSetClassHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.sc", new AList<Class<?>>().appendAll(String.class, Integer.class));
b2.set("A.f1.sc", new Class<?>[]{Integer.class,String.class});
@@ -1164,8 +1164,8 @@ public class PropertyStore2Test {
@Test
public void testListStringHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.ls", new AList<String>().appendAll("foo", "bar"));
b2.set("A.f1.ls", new String[]{"foo","bar"});
@@ -1201,8 +1201,8 @@ public class PropertyStore2Test {
@Test
public void testListIntegerHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.li", new AList<String>().appendAll("1", "2"));
b2.set("A.f1.li", new String[]{"1","2"});
@@ -1238,8 +1238,8 @@ public class PropertyStore2Test {
@Test
public void testListClassHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.lc", new AList<Class<?>>().appendAll(String.class, Integer.class));
@@ -1273,8 +1273,8 @@ public class PropertyStore2Test {
@Test
public void testListObjectHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.lo", new AList<Object>().appendAll("foo", 123, true, TestEnum.ONE));
@@ -1306,8 +1306,8 @@ public class PropertyStore2Test {
@Test
public void testMapStringHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.ms", new AMap<String,String>().append("foo", "123").append("bar", "true").append("baz", null).append(null, null));
b2.set("A.f1.ms", new AMap<String,Object>().append("foo", 123).append("bar", true).append("baz", null).append(null, null));
@@ -1337,8 +1337,8 @@ public class PropertyStore2Test {
@Test
public void testMapIntegerHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.mi", new AMap<String,Integer>().append("foo", 123).append("bar", 456).append("baz", null).append(null, null));
b2.set("A.f1.mi", new AMap<String,Object>().append("foo", 123).append("bar", "456").append("baz", null).append(null, null));
@@ -1368,8 +1368,8 @@ public class PropertyStore2Test {
@Test
public void testMapClassHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.mc", new AMap<String,Class<?>>().append("foo", String.class).append("bar", Integer.class).append("baz", null).append(null, null));
b2.set("A.f1.mc", new AMap<String,Object>().append("foo", String.class).append("bar", Integer.class).append("baz", null).append(null, null));
@@ -1400,8 +1400,8 @@ public class PropertyStore2Test {
@Test
public void testMapObjectHash() throws Exception {
- PropertyStoreBuilder b1 = PropertyStore2.create(), b2 = PropertyStore2.create();
- PropertyStore2 ps = null;
+ PropertyStoreBuilder b1 = PropertyStore.create(), b2 = PropertyStore.create();
+ PropertyStore ps = null;
b1.set("A.f1.mo", new AMap<String,TestEnum>().append("foo", TestEnum.ONE).append("bar", TestEnum.TWO).append("baz", null).append(null, null));
b2.set("A.f1.mo", new AMap<String,Object>().append("foo", TestEnum.ONE).append("bar", TestEnum.TWO).append("baz", null).append(null, null));
@@ -1436,7 +1436,7 @@ public class PropertyStore2Test {
@Test
public void testStringDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1", "foo");
assertEquals("foo", ps.getProperty("A.f1"));
@@ -1445,7 +1445,7 @@ public class PropertyStore2Test {
@Test
public void testIntegerDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.i", "1");
assertEquals(1, ps.getProperty("A.f1.i"));
@@ -1455,7 +1455,7 @@ public class PropertyStore2Test {
@Test
public void testObjectDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.o", "123");
assertEquals("123", ps.getProperty("A.f1.o"));
@@ -1465,7 +1465,7 @@ public class PropertyStore2Test {
@Test
public void testSetStringDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.ss", "['foo','bar']");
assertObjectEquals("['bar','foo']", ps.getProperty("A.f1.ss"));
@@ -1474,7 +1474,7 @@ public class PropertyStore2Test {
@Test
public void testSetIntegerDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.si", "['2','1']");
assertObjectEquals("[1,2]", ps.getProperty("A.f1.si"));
@@ -1483,7 +1483,7 @@ public class PropertyStore2Test {
@Test
public void testListStringDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.ls", "['foo','bar']");
assertObjectEquals("['foo','bar']", ps.getProperty("A.f1.ls"));
@@ -1492,7 +1492,7 @@ public class PropertyStore2Test {
@Test
public void testListIntegerDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.li", "['2','1']");
assertObjectEquals("[2,1]", ps.getProperty("A.f1.li"));
@@ -1501,7 +1501,7 @@ public class PropertyStore2Test {
@Test
public void testMapStringDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.ms", "{foo:'bar',baz:null}");
assertObjectEquals("{foo:'bar'}", ps.getProperty("A.f1.ms"));
@@ -1510,7 +1510,7 @@ public class PropertyStore2Test {
@Test
public void testMapIntegerDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.mi", "{foo:'123',baz:null}");
assertObjectEquals("{foo:123}", ps.getProperty("A.f1.mi"));
@@ -1519,7 +1519,7 @@ public class PropertyStore2Test {
@Test
public void testMapObjectDefault() {
- PropertyStore2 ps = PropertyStore2.create().build();
+ PropertyStore ps = PropertyStore.create().build();
System.setProperty("A.f1.mo", "{foo:123,bar:'baz',qux:true,quux:null}");
assertObjectEquals("{bar:'baz',foo:123,qux:true}", ps.getProperty("A.f1.mo"));
@@ -1532,17 +1532,17 @@ public class PropertyStore2Test {
@Test
public void testBuilderFromStore() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set("A.foo", "bar");
- PropertyStore2 ps1 = b.build();
+ PropertyStore ps1 = b.build();
b = ps1.builder();
assertObjectEquals("{A:{foo:'bar'}}", b.build());
}
@Test
public void testSet() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set(new ObjectMap().append("A.foo", "bar"));
b.set(new ObjectMap().append("A.baz", "qux"));
b.add(null);
@@ -1551,7 +1551,7 @@ public class PropertyStore2Test {
@Test
public void testAdd() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.add(new ObjectMap().append("A.foo", "bar"));
b.add(new ObjectMap().append("A.baz", "qux"));
b.add(new ObjectMap().append("A.quux", null));
@@ -1561,21 +1561,21 @@ public class PropertyStore2Test {
@Test
public void testRemoveNotExisting() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.removeFrom("A.foo.ls", "bar");
assertObjectEquals("{}", b.build());
}
@Test
public void testAddToNull() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.addTo("A.foo.ls", null);
assertObjectEquals("{}", b.build());
}
@Test
public void testRemoveNull() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.removeFrom("A.foo.ss", null);
assertObjectEquals("{}", b.build());
b.removeFrom("A.foo.ls", null);
@@ -1584,7 +1584,7 @@ public class PropertyStore2Test {
@Test
public void testRemoveFromInvalidObjectList() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
try {
b.removeFrom("A.foo.ss", "[xxx]");
fail("Exception expected.");
@@ -1601,7 +1601,7 @@ public class PropertyStore2Test {
@Test
public void testAddToInvalidObjectMap() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
try {
b.addTo("A.foo.ms", "{xxx}");
fail("Exception expected.");
@@ -1624,16 +1624,16 @@ public class PropertyStore2Test {
@Test
public void testGetNonExistent() {
- PropertyStore2 b = PropertyStore2.create().set("A.foo", "bar").build();
+ PropertyStore b = PropertyStore.create().set("A.foo", "bar").build();
assertNull(b.getProperty("A.baz"));
assertNull(b.getProperty("B.foo"));
}
@Test
public void testHashCodes() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set("A.foo", "bar").set("B.foo", "bar");
- PropertyStore2 ps = b.build();
+ PropertyStore ps = b.build();
assertEquals(ps.hashCode("A","B","C",null),ps.hashCode("A","B","C",null));
assertNotEquals(ps.hashCode("A"),ps.hashCode("B"));
@@ -1642,18 +1642,18 @@ public class PropertyStore2Test {
@Test
public void testEquals() {
- PropertyStoreBuilder b = PropertyStore2.create();
- PropertyStore2 ps = b.build();
+ PropertyStoreBuilder b = PropertyStore.create();
+ PropertyStore ps = b.build();
assertFalse(ps.equals("foo"));
}
@Test
public void testEqualsByGroups() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set("A.foo", "bar").set("B.foo", "bar").set("D.foo", "bar");
- PropertyStore2 ps1 = b.build();
+ PropertyStore ps1 = b.build();
b.remove("A.foo").set("C.foo", "bar").set("D.foo", "baz");
- PropertyStore2 ps2 = b.build();
+ PropertyStore ps2 = b.build();
assertTrue(ps1.equals(ps1, null, null));
assertTrue(ps1.equals(ps2, null, null));
@@ -1668,9 +1668,9 @@ public class PropertyStore2Test {
@Test
public void testKeySet() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set("A.foo", "bar").set("B.foo", "bar").set("D.foo", "bar");
- PropertyStore2 ps = b.build();
+ PropertyStore ps = b.build();
assertObjectEquals("[]", ps.getPropertyKeys(null));
assertObjectEquals("['foo']", ps.getPropertyKeys("A"));
@@ -1679,7 +1679,7 @@ public class PropertyStore2Test {
@Test
public void testToMutable() {
- PropertyStoreBuilder b = PropertyStore2.create();
+ PropertyStoreBuilder b = PropertyStore.create();
b.set("A.foo.s", "bar");
b.set("A.foo.b", true);
b.set("A.foo.i", 123);
@@ -1696,7 +1696,7 @@ public class PropertyStore2Test {
b.set("A.foo.mi", "{foo:123}");
b.set("A.foo.mc/add.foo", String.class);
b.set("A.foo.mo/add.foo", StringBuilder.class);
- PropertyStore2 ps = b.build();
+ PropertyStore ps = b.build();
b = ps.builder();
ps = b.build();
@@ -1706,7 +1706,7 @@ public class PropertyStore2Test {
@Test
public void testToString() {
- PropertyStore2 p = PropertyStore2.create().build();
+ PropertyStore p = PropertyStore.create().build();
assertEquals("{}", p.toString());
}
@@ -1730,7 +1730,7 @@ public class PropertyStore2Test {
}
private void testNotEquals(PropertyStoreBuilder b1, PropertyStoreBuilder b2) {
- PropertyStore2 p1 = b1.build(), p2 = b2.build();
+ PropertyStore p1 = b1.build(), p2 = b2.build();
assertTrue(p1 != p2);
assertTrue(p1.hashCode() != p2.hashCode());
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParser.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParser.java
index 7703ddb..14073cc 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParser.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParser.java
@@ -30,7 +30,7 @@ import org.apache.juneau.xml.*;
public class XmlValidatorParser extends XmlParser {
public XmlValidatorParser() {
- super(PropertyStore2.DEFAULT);
+ super(PropertyStore.DEFAULT);
}
@Override /* Parser */
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParserBuilder.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParserBuilder.java
index 8c68e7c..1a2d799 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParserBuilder.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/XmlValidatorParserBuilder.java
@@ -17,7 +17,7 @@ import org.apache.juneau.xml.*;
public class XmlValidatorParserBuilder extends XmlParserBuilder {
public XmlValidatorParserBuilder() {
- super(PropertyStore2.DEFAULT);
+ super(PropertyStore.DEFAULT);
}
@Override
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
index a984635..f3e726b 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
@@ -46,19 +46,19 @@ public class ParserGroupTest {
public static class Parser1 extends JsonParser {
- public Parser1(PropertyStore2 ps) {
+ public Parser1(PropertyStore ps) {
super(ps, "text/foo", "text/foo_a");
}
}
public static class Parser2 extends JsonParser {
- public Parser2(PropertyStore2 ps) {
+ public Parser2(PropertyStore ps) {
super(ps, "text/foo+bar", "text/foo+bar_a");
}
}
public static class Parser3 extends JsonParser {
- public Parser3(PropertyStore2 ps) {
+ public Parser3(PropertyStore ps) {
super(ps, "text/baz", "text/baz_a");
}
}
@@ -85,31 +85,31 @@ public class ParserGroupTest {
}
public static class P1 extends JsonParser {
- public P1(PropertyStore2 ps) {
+ public P1(PropertyStore ps) {
super(ps, "text/1");
}
}
public static class P2 extends JsonParser {
- public P2(PropertyStore2 ps) {
+ public P2(PropertyStore ps) {
super(ps, "text/2", "text/2a");
}
}
public static class P3 extends JsonParser {
- public P3(PropertyStore2 ps) {
+ public P3(PropertyStore ps) {
super(ps, "text/3");
}
}
public static class P4 extends JsonParser {
- public P4(PropertyStore2 ps) {
+ public P4(PropertyStore ps) {
super(ps, "text/4", "text/4a");
}
}
public static class P5 extends JsonParser {
- public P5(PropertyStore2 ps) {
+ public P5(PropertyStore ps) {
super(ps, "text/5");
}
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
index 45f3383..0fb0c5d 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
@@ -51,19 +51,19 @@ public class SerializerGroupTest {
public static class SA1 extends JsonSerializer {
- public SA1(PropertyStore2 ps) {
+ public SA1(PropertyStore ps) {
super(ps, "application/json", "text/foo+*", "text/foo_a+*");
}
}
public static class SA2 extends JsonSerializer {
- public SA2(PropertyStore2 ps) {
+ public SA2(PropertyStore ps) {
super(ps, "application/json", "text/foo+bar+*", "text/foo+bar_a+*");
}
}
public static class SA3 extends JsonSerializer {
- public SA3(PropertyStore2 ps) {
+ public SA3(PropertyStore ps) {
super(ps, "application/json", "text/baz+*", "text/baz_a+*");
}
}
@@ -90,31 +90,31 @@ public class SerializerGroupTest {
}
public static class SB1 extends JsonSerializer {
- public SB1(PropertyStore2 ps) {
+ public SB1(PropertyStore ps) {
super(ps, "application/json", "text/1");
}
}
public static class SB2 extends JsonSerializer {
- public SB2(PropertyStore2 ps) {
+ public SB2(PropertyStore ps) {
super(ps, "application/json", "text/2", "text/2a");
}
}
public static class SB3 extends JsonSerializer {
- public SB3(PropertyStore2 ps) {
+ public SB3(PropertyStore ps) {
super(ps, "application/json", "text/3");
}
}
public static class SB4 extends JsonSerializer {
- public SB4(PropertyStore2 ps) {
+ public SB4(PropertyStore ps) {
super(ps, "application/json", "text/4", "text/4a");
}
}
public static class SB5 extends JsonSerializer {
- public SB5(PropertyStore2 ps) {
+ public SB5(PropertyStore ps) {
super(ps, "application/json", "text/5");
}
}
@@ -135,19 +135,19 @@ public class SerializerGroupTest {
}
public static class SC1 extends JsonSerializer {
- public SC1(PropertyStore2 ps) {
+ public SC1(PropertyStore ps) {
super(ps, "application/json", "text/*");
}
}
public static class SC2 extends JsonSerializer {
- public SC2(PropertyStore2 ps) {
+ public SC2(PropertyStore ps) {
super(ps, "application/json", "*/json");
}
}
public static class SC3 extends JsonSerializer {
- public SC3(PropertyStore2 ps) {
+ public SC3(PropertyStore ps) {
super(ps, "application/json", "*/*");
}
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index bbe95d4..a7217ca 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -74,16 +74,16 @@ public class RdfParser extends ReaderParser implements RdfCommon {
//-------------------------------------------------------------------------------------------------------------------
/** Default XML parser, all default settings.*/
- public static final RdfParser DEFAULT_XML = new Xml(PropertyStore2.DEFAULT);
+ public static final RdfParser DEFAULT_XML = new Xml(PropertyStore.DEFAULT);
/** Default Turtle parser, all default settings.*/
- public static final RdfParser DEFAULT_TURTLE = new Turtle(PropertyStore2.DEFAULT);
+ public static final RdfParser DEFAULT_TURTLE = new Turtle(PropertyStore.DEFAULT);
/** Default N-Triple parser, all default settings.*/
- public static final RdfParser DEFAULT_NTRIPLE = new NTriple(PropertyStore2.DEFAULT);
+ public static final RdfParser DEFAULT_NTRIPLE = new NTriple(PropertyStore.DEFAULT);
/** Default N3 parser, all default settings.*/
- public static final RdfParser DEFAULT_N3 = new N3(PropertyStore2.DEFAULT);
+ public static final RdfParser DEFAULT_N3 = new N3(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -98,7 +98,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public Xml(PropertyStore2 ps) {
+ public Xml(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_RDF_XML)
@@ -116,7 +116,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public NTriple(PropertyStore2 ps) {
+ public NTriple(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_NTRIPLE)
@@ -134,7 +134,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public Turtle(PropertyStore2 ps) {
+ public Turtle(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_TURTLE)
@@ -152,7 +152,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public N3(PropertyStore2 ps) {
+ public N3(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_N3)
@@ -178,7 +178,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
* @param ps The property store containing all the settings for this object.
* @param consumes The list of media types that this parser consumes (e.g. <js>"application/json"</js>).
*/
- public RdfParser(PropertyStore2 ps, String...consumes) {
+ public RdfParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
trimWhitespace = getProperty(RDF_trimWhitespace, boolean.class, false);
looseCollections = getProperty(RDF_looseCollections, boolean.class, false);
@@ -193,7 +193,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public RdfParser(PropertyStore2 ps) {
+ public RdfParser(PropertyStore ps) {
this(ps, "text/xml+rdf");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParserBuilder.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParserBuilder.java
index 87d830f..a126b9a 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParserBuilder.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParserBuilder.java
@@ -41,7 +41,7 @@ public class RdfParserBuilder extends ParserBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public RdfParserBuilder(PropertyStore2 ps) {
+ public RdfParserBuilder(PropertyStore ps) {
super(ps);
}
@@ -710,7 +710,7 @@ public class RdfParserBuilder extends ParserBuilder {
}
@Override /* ContextBuilder */
- public RdfParserBuilder apply(PropertyStore2 copyFrom) {
+ public RdfParserBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
index 0f4d042..aee78d6 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
@@ -146,19 +146,19 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
//-------------------------------------------------------------------------------------------------------------------
/** Default RDF/XML serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_XML = new Xml(PropertyStore2.DEFAULT);
+ public static final RdfSerializer DEFAULT_XML = new Xml(PropertyStore.DEFAULT);
/** Default Abbreviated RDF/XML serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_XMLABBREV = new XmlAbbrev(PropertyStore2.DEFAULT);
+ public static final RdfSerializer DEFAULT_XMLABBREV = new XmlAbbrev(PropertyStore.DEFAULT);
/** Default Turtle serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_TURTLE = new Turtle(PropertyStore2.DEFAULT);
+ public static final RdfSerializer DEFAULT_TURTLE = new Turtle(PropertyStore.DEFAULT);
/** Default N-Triple serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_NTRIPLE = new NTriple(PropertyStore2.DEFAULT);
+ public static final RdfSerializer DEFAULT_NTRIPLE = new NTriple(PropertyStore.DEFAULT);
/** Default N3 serializer, all default settings.*/
- public static final RdfSerializer DEFAULT_N3 = new N3(PropertyStore2.DEFAULT);
+ public static final RdfSerializer DEFAULT_N3 = new N3(PropertyStore.DEFAULT);
//-------------------------------------------------------------------------------------------------------------------
@@ -173,7 +173,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public Xml(PropertyStore2 ps) {
+ public Xml(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_RDF_XML)
@@ -191,7 +191,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public XmlAbbrev(PropertyStore2 ps) {
+ public XmlAbbrev(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_RDF_XML_ABBREV)
@@ -210,7 +210,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public NTriple(PropertyStore2 ps) {
+ public NTriple(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_NTRIPLE)
@@ -228,7 +228,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public Turtle(PropertyStore2 ps) {
+ public Turtle(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_TURTLE)
@@ -246,7 +246,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
*
* @param ps The property store containing all the settings for this object.
*/
- public N3(PropertyStore2 ps) {
+ public N3(PropertyStore ps) {
super(
ps.builder()
.set(RDF_language, LANG_N3)
@@ -296,7 +296,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
* <br>...or...
* <br><code><jk>super</jk>(propertyStore, <js>"application/json"</js>, <js>"*​/json"</js>);</code>
*/
- public RdfSerializer(PropertyStore2 ps, String produces, String...accept) {
+ public RdfSerializer(PropertyStore ps, String produces, String...accept) {
super(ps, produces, accept);
addLiteralTypes = getProperty(RDF_addLiteralTypes, boolean.class, false);
addRootProperty = getProperty(RDF_addRootProperty, boolean.class, false);
@@ -323,7 +323,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
* @param ps
* The property store containing all the settings for this object.
*/
- public RdfSerializer(PropertyStore2 ps) {
+ public RdfSerializer(PropertyStore ps) {
this(ps, "text/xml+rdf");
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
index 25e7a81..6ccde5f 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
@@ -41,7 +41,7 @@ public class RdfSerializerBuilder extends SerializerBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public RdfSerializerBuilder(PropertyStore2 ps) {
+ public RdfSerializerBuilder(PropertyStore ps) {
super(ps);
}
@@ -902,7 +902,7 @@ public class RdfSerializerBuilder extends SerializerBuilder {
}
@Override /* ContextBuilder */
- public RdfSerializerBuilder apply(PropertyStore2 copyFrom) {
+ public RdfSerializerBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
index b959961..a002ff7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
@@ -955,7 +955,7 @@ public class BeanContext extends Context {
*
* @param ps The property store containing the unmodifiable configuration for this bean context.
*/
- public BeanContext(PropertyStore2 ps) {
+ public BeanContext(PropertyStore ps) {
super(ps);
hashCode = ps.hashCode("BeanContext");
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
index 86680d9..5b19d6e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
@@ -43,7 +43,7 @@ public class BeanContextBuilder extends ContextBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public BeanContextBuilder(PropertyStore2 ps) {
+ public BeanContextBuilder(PropertyStore ps) {
super(ps);
}
@@ -1272,7 +1272,7 @@ public class BeanContextBuilder extends ContextBuilder {
}
@Override /* ContextBuilder */
- public BeanContextBuilder apply(PropertyStore2 copyFrom) {
+ public BeanContextBuilder apply(PropertyStore copyFrom) {
super.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
index 9fa193f..06178c3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
@@ -26,16 +26,16 @@ import org.apache.juneau.serializer.*;
* Contexts are created through the {@link ContextBuilder#build()} method.
*
* <p>
- * Subclasses MUST implement a constructor method that takes in a {@link PropertyStore2} parameter.
+ * Subclasses MUST implement a constructor method that takes in a {@link PropertyStore} parameter.
* Besides that restriction, a context object can do anything you desire.
* However, it MUST be thread-safe and all fields should be declared final to prevent modification.
* It should NOT be used for storing temporary or state information.
*
- * @see PropertyStore2
+ * @see PropertyStore
*/
public abstract class Context {
- private final PropertyStore2 propertyStore;
+ private final PropertyStore propertyStore;
/**
* Constructor for this class.
@@ -45,8 +45,8 @@ public abstract class Context {
*
* @param ps The read-only configuration for this context object.
*/
- public Context(PropertyStore2 ps) {
- this.propertyStore = ps == null ? PropertyStore2.DEFAULT : ps;
+ public Context(PropertyStore ps) {
+ this.propertyStore = ps == null ? PropertyStore.DEFAULT : ps;
}
/**
@@ -279,7 +279,7 @@ public abstract class Context {
* @return The property store associated with this context.
*/
@BeanIgnore
- public final PropertyStore2 getPropertyStore() {
+ public final PropertyStore getPropertyStore() {
return propertyStore;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBuilder.java
index 5616cdd..3be7636 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBuilder.java
@@ -27,7 +27,7 @@ public abstract class ContextBuilder {
* Default settings.
*/
public ContextBuilder() {
- this.psb = PropertyStore2.create();
+ this.psb = PropertyStore.create();
}
/**
@@ -35,7 +35,7 @@ public abstract class ContextBuilder {
*
* @param ps The initial configuration settings for this builder.
*/
- public ContextBuilder(PropertyStore2 ps) {
+ public ContextBuilder(PropertyStore ps) {
this.psb = ps.builder();
}
@@ -53,7 +53,7 @@ public abstract class ContextBuilder {
* @param copyFrom The factory whose settings are being copied.
* @return This object (for method chaining).
*/
- public ContextBuilder apply(PropertyStore2 copyFrom) {
+ public ContextBuilder apply(PropertyStore copyFrom) {
this.psb.apply(copyFrom);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextCache.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextCache.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextCache.java
index 7fae9bf..6784111 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextCache.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextCache.java
@@ -96,7 +96,7 @@ public class ContextCache {
* @param ps The property store to use to create the class.
* @return The
*/
- public <T extends Context> T create(Class<T> c, PropertyStore2 ps) {
+ public <T extends Context> T create(Class<T> c, PropertyStore ps) {
ConcurrentHashMap<Integer,CacheEntry> m = getContextCache(c);
String[] prefixes = getPrefixes(c);
@@ -151,7 +151,7 @@ public class ContextCache {
Constructor<?> c = constructorCache.get(cc);
if (c == null) {
try {
- c = cc.getConstructor(PropertyStore2.class);
+ c = cc.getConstructor(PropertyStore.class);
} catch (NoSuchMethodException e) {
throw new ContextRuntimeException(e, "Public constructor with PropertyStore argument not found on class ''{0}''", cc);
}
@@ -163,10 +163,10 @@ public class ContextCache {
}
private static class CacheEntry {
- final PropertyStore2 ps;
+ final PropertyStore ps;
final Context context;
- CacheEntry(PropertyStore2 ps, Context context) {
+ CacheEntry(PropertyStore ps, Context context) {
this.ps = ps;
this.context = context;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/b49b9192/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java
new file mode 100644
index 0000000..a6971a9
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStore.java
@@ -0,0 +1,748 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau;
+
+import static org.apache.juneau.PropertyType.*;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import org.apache.juneau.PropertyStoreBuilder.*;
+import org.apache.juneau.internal.*;
+import org.apache.juneau.json.*;
+import org.apache.juneau.serializer.*;
+
+
+/**
+ * Represents an immutable collection of properties.
+ *
+ * <p>
+ * The general idea behind a property store is to serve as a reusable configuration of an artifact (e.g. a Serializer)
+ * such that the artifact can be cached and reused if the property stores are 'equal'.
+ *
+ * <p>
+ * For example, two serializers of the same type created with the same configuration will always end up being
+ * the same serializer:
+ *
+ * <p class='bcode'>
+ * WriterSerializer s1 = JsonSerializer.<jsm>create</jsm>().pojoSwaps(MySwap.<jk>class</jk>).simple().build();
+ * WriterSerializer s2 = JsonSerializer.<jsm>create</jsm>().simple().pojoSwaps(MySwap.<jk>class</jk>).build();
+ * <jk>assert</jk>(s1 == s2);
+ * </p>
+ *
+ * <p>
+ * This has the effect of significantly improving performance, especially if you're creating many Serializers and
+ * Parsers.
+ *
+ * <p>
+ * Property names must have the following format...
+ * <p class='bcode'>
+ * <js>"{group}.{name}.{type}"</js>
+ * </p>
+ * ...where the parts consist of the following...
+ * <ul>
+ * <li><js>"{group}"</js> - The group name of the property (e.g. <js>"JsonSerializer"</js>).
+ * <br>It's always going to be the simple class name of the class it's associated with.
+ * <li><js>"{name}"</js> - The property name (e.g. <js>"useWhitespace"</js>).
+ * <li><js>"{type}"</js> - The property data type.
+ * <br>A 1 or 2 character string that identifies the data type of the property.
+ * <br>Valid values are:
+ * <ul>
+ * <li><js>"s"<js>: <code>String</code>
+ * <li><js>"b"<js>: <code>Boolean</code>
+ * <li><js>"i"<js>: <code>Integer</code>
+ * <li><js>"c"<js>: <code>Class</code>
+ * <li><js>"o"<js>: <code>Object</code>
+ * <li><js>"ss"<js>: <code>TreeSet<String></code>
+ * <li><js>"si"<js>: <code>TreeSet<Integer></code>
+ * <li><js>"sc"<js>: <code>TreeSet<Class></code>
+ * <li><js>"ls"<js>: <code>ArrayList<String></code>
+ * <li><js>"li"<js>: <code>ArrayList<Integer></code>
+ * <li><js>"lc"<js>: <code>ArrayList<Class></code>
+ * <li><js>"lo"<js>: <code>ArrayList<Object></code>
+ * <li><js>"ms"<js>: <code>TreeMap<String,String></code>
+ * <li><js>"mi"<js>: <code>TreeMap<String,Integer></code>
+ * <li><js>"mc"<js>: <code>TreeMap<String,Class></code>
+ * <li><js>"mo"<js>: <code>TreeMap<String,Object></code>
+ * </ul>
+ * </ul>
+ *
+ * <p>
+ * For example, the {@link JsonSerializer} extends from {@link Serializer} and {@link BeanContext}, and therefore
+ * is configured by properties defined in the <js>"JsonSerializer"</js>, <js>"Serializer"</js>, and <js>"BeanContext"</js>
+ * groups. Since serializers and bean contexts can be relatively expensive to instantiate, we can cache and
+ * reuse <code>JsonSerializer</code> instances if the property store used to instantiate them have equivalent
+ * <js>"JsonSerializer"</js>, <js>"Serializer"</js>, and <js>"BeanContext"</js> groups.
+ *
+ * <p>
+ * Set and list properties have the additional convenience 'command' names for adding and removing entries:
+ * <p class='bcode'>
+ * <js>"{group}.{name}.{type}/add"</js> <jc>// Add a value to the set/list.</jc>
+ * <js>"{group}.{name}.{type}/remove"</js> <jc>// Remove a value from the set/list.</jc>
+ * </p>
+ *
+ * <p>
+ * Set properties are typically used in cases where the order of the value is not important.
+ * A <code>TreeSet</code> is used so that the order in which you add elements does not affect the resulting order
+ * of the property.
+ *
+ * <p>
+ * List properties are typically used in cases where the order in which entries are added is important.
+ * Adding to a list property will cause the new entries to be added to the BEGINNING of the list.
+ * This ensures that the resulting order of the list is in most-to-least importance.
+ * For example, multiple calls to <code>pojoSwaps()</code> causes new entries to be added to the beginning of the list
+ * so that previous values can be 'overridden':
+ * <p class='bcode'>
+ * <jc>// Swap order: [MySwap2.class, MySwap1.class]</jc>
+ * JsonSerializer.create().pojoSwaps(MySwap1.class).pojoSwaps(MySwap2.class).build();
+ * </p>
+ * <p>
+ * Note that the order is different when passing multiple values into the <code>pojoSwaps()</code> method, in which
+ * case the order should be first-match-wins:
+ * <p class='bcode'>
+ * <jc>// Swap order: [MySwap1.class, MySwap2.class]</jc>
+ * JsonSerializer.create().pojoSwaps(MySwap1.class,MySwap2.class).build();
+ * </p>
+ *
+ * <p>
+ * Map properties have the additional convenience property name for adding and removing map entries:
+ * <p class='bcode'>
+ * <js>"{group}.{name}.{type}/add.{key}"</js> <jc>// Add a map entry (or delete if the value is null).</jc>
+ * </p>
+ *
+ * <p>
+ * Property stores are entirely immutable which means their hashcode is calculated exactly once, meaning they
+ * are particularly good for use as hashmap keys.
+ */
+@SuppressWarnings("unchecked")
+public final class PropertyStore {
+
+ /**
+ * A default empty property store.
+ */
+ public static PropertyStore DEFAULT = PropertyStore.create().build();
+
+ final SortedMap<String,PropertyGroup> groups;
+ private final int hashCode;
+
+ // Created by PropertyStoreBuilder.build()
+ PropertyStore(Map<String,PropertyGroupBuilder> propertyMaps) {
+ TreeMap<String,PropertyGroup> m = new TreeMap<>();
+ for (Map.Entry<String,PropertyGroupBuilder> p : propertyMaps.entrySet())
+ m.put(p.getKey(), p.getValue().build());
+ this.groups = Collections.unmodifiableSortedMap(m);
+ this.hashCode = groups.hashCode();
+ }
+
+ /**
+ * Creates a new empty builder for a property store.
+ *
+ * @return A new empty builder for a property store.
+ */
+ public static PropertyStoreBuilder create() {
+ return new PropertyStoreBuilder();
+ }
+
+ /**
+ * Creates a new property store builder initialized with the values in this property store.
+ *
+ * @return A new property store builder.
+ */
+ public PropertyStoreBuilder builder() {
+ return new PropertyStoreBuilder(this);
+ }
+
+ private Property findProperty(String key) {
+ String g = group(key);
+ String k = key.substring(g.length()+1);
+ PropertyGroup pm = groups.get(g);
+
+ if (pm != null) {
+ Property p = pm.get(k);
+ if (p != null)
+ return p;
+ }
+
+ String s = System.getProperty(key);
+ if (s != null)
+ return PropertyStoreBuilder.MutableProperty.create(k, s).build();
+
+ return null;
+ }
+
+ /**
+ * Returns the raw property value with the specified name.
+ *
+ * @param key The property name.
+ * @return The property value, or <jk>null</jk> if it doesn't exist.
+ */
+ public Object getProperty(String key) {
+ Property p = findProperty(key);
+ return p == null ? null : p.value;
+ }
+
+ /**
+ * Returns the property value with the specified name.
+ *
+ * @param key The property name.
+ * @param c The class to cast or convert the value to.
+ * @param def The default value.
+ * @return The property value, or the default value if it doesn't exist.
+ */
+ public <T> T getProperty(String key, Class<T> c, T def) {
+ Property p = findProperty(key);
+ return p == null ? def : p.as(c);
+ }
+
+ /**
+ * Returns the class property with the specified name.
+ *
+ * @param key The property name.
+ * @param type The class type of the property.
+ * @param def The default value.
+ * @return The property value, or the default value if it doesn't exist.
+ */
+ public <T> Class<? extends T> getClassProperty(String key, Class<T> type, Class<? extends T> def) {
+ Property p = findProperty(key);
+ return p == null ? def : (Class<T>)p.as(Class.class);
+ }
+
+ /**
+ * Returns the array property value with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value, or an empty array if it doesn't exist.
+ */
+ public <T> T[] getArrayProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return (T[]) (p == null ? Array.newInstance(eType, 0) : p.asArray(eType));
+ }
+
+ /**
+ * Returns the array property value with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @param def The default value.
+ * @return The property value, or an empty array if it doesn't exist.
+ */
+ public <T> T[] getArrayProperty(String key, Class<T> eType, T[] def) {
+ Property p = findProperty(key);
+ return p == null ? def : p.asArray(eType);
+ }
+
+ /**
+ * Returns the class array property with the specified name.
+ *
+ * @param key The property name.
+ * @return The property value, or an empty array if it doesn't exist.
+ */
+ public Class<?>[] getClassArrayProperty(String key) {
+ Property p = findProperty(key);
+ return p == null ? new Class[0] : p.as(Class[].class);
+ }
+
+ /**
+ * Returns the class array property with the specified name.
+ *
+ * @param key The property name.
+ * @param def The default value.
+ * @return The property value, or an empty array if it doesn't exist.
+ */
+ public Class<?>[] getClassArrayProperty(String key, Class<?>[] def) {
+ Property p = findProperty(key);
+ return p == null ? def : p.as(Class[].class);
+ }
+
+ /**
+ * Returns the class array property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value, or an empty array if it doesn't exist.
+ */
+ public <T> Class<T>[] getClassArrayProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? new Class[0] : p.as(Class[].class);
+ }
+
+ /**
+ * Returns the set property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value as an unmodifiable <code>LinkedHashSet</code>, or an empty set if it doesn't exist.
+ */
+ public <T> Set<T> getSetProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_SET : p.asSet(eType);
+ }
+
+ /**
+ * Returns the class set property with the specified name.
+ *
+ * @param key The property name.
+ * @return The property value as an unmodifiable <code>LinkedHashSet</code>, or an empty set if it doesn't exist.
+ */
+ public Set<Class<?>> getClassSetProperty(String key) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_SET : p.asSet(Class.class);
+ }
+
+ /**
+ * Returns the class set property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value as an unmodifiable <code>LinkedHashSet</code>, or an empty set if it doesn't exist.
+ */
+ public <T> Set<Class<T>> getClassSetProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_SET : p.asSet(Class.class);
+ }
+
+ /**
+ * Returns the list property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value as an unmodifiable <code>ArrayList</code>, or an empty list if it doesn't exist.
+ */
+ public <T> List<T> getListProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_LIST : p.asList(eType);
+ }
+
+ /**
+ * Returns the class list property with the specified name.
+ *
+ * @param key The property name.
+ * @return The property value as an unmodifiable <code>ArrayList</code>, or an empty list if it doesn't exist.
+ */
+ public List<Class<?>> getClassListProperty(String key) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_LIST : p.asList(Class.class);
+ }
+
+ /**
+ * Returns the class list property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value as an unmodifiable <code>ArrayList</code>, or an empty list if it doesn't exist.
+ */
+ public <T> List<Class<T>> getClassListProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_LIST : p.asList(Class.class);
+ }
+
+ /**
+ * Returns the map property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value as an unmodifiable <code>LinkedHashMap</code>, or an empty map if it doesn't exist.
+ */
+ public <T> Map<String,T> getMapProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_MAP : p.asMap(eType);
+ }
+
+ /**
+ * Returns the class map property with the specified name.
+ *
+ * @param key The property name.
+ * @return The property value as an unmodifiable <code>LinkedHashMap</code>, or an empty map if it doesn't exist.
+ */
+ public Map<String,Class<?>> getClassMapProperty(String key) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_MAP : p.asMap(Class.class);
+ }
+
+ /**
+ * Returns the class map property with the specified name.
+ *
+ * @param key The property name.
+ * @param eType The class type of the elements in the property.
+ * @return The property value as an unmodifiable <code>LinkedHashMap</code>, or an empty map if it doesn't exist.
+ */
+ public <T> Map<String,Class<T>> getClassMapProperty(String key, Class<T> eType) {
+ Property p = findProperty(key);
+ return p == null ? Collections.EMPTY_MAP : p.asMap(Class.class);
+ }
+
+ /**
+ * Returns an instance of the specified class or string property.
+ *
+ * @param key The property name.
+ * @param type The class type of the property.
+ * @param def
+ * The default value if the property doesn't exist.
+ * <br>Can either be an instance of <code>T</code>, or a <code>Class<? <jk>extends</jk> T></code>.
+ * @return A new property instance.
+ */
+ public <T> T getInstanceProperty(String key, Class<T> type, Object def) {
+ Property p = findProperty(key);
+ if (p != null)
+ return p.asInstance(type);
+ if (def == null)
+ return null;
+ if (def instanceof Class) {
+ T t = ClassUtils.newInstance(type, def);
+ if (t != null)
+ return t;
+ }
+ if (type.isInstance(def))
+ return (T)def;
+ throw new ConfigException("Could not instantiate property ''{0}'' as type ''{1}'' with default value ''{2}''", key, type, def);
+ }
+
+ /**
+ * Returns the specified property as an array of instantiated objects.
+ *
+ * @param key The property name.
+ * @param type The class type of the property.
+ * @param def The default object to return if the property doesn't exist.
+ * @return A new property instance.
+ */
+ public <T> T[] getInstanceArrayProperty(String key, Class<T> type, T[] def) {
+ Property p = findProperty(key);
+ return p == null ? def : p.asInstanceArray(type);
+ }
+
+ /**
+ * Returns the keys found in the specified property group.
+ *
+ * <p>
+ * The keys are NOT prefixed with group names.
+ *
+ * @param group The group name.
+ * @return The set of property keys, or an empty set if the group was not found.
+ */
+ public Set<String> getPropertyKeys(String group) {
+ if (group == null)
+ return Collections.EMPTY_SET;
+ PropertyGroup g = groups.get(group);
+ return g == null ? Collections.EMPTY_SET : g.keySet();
+ }
+
+ @Override /* Object */
+ public int hashCode() {
+ return hashCode;
+ }
+
+ /**
+ * Returns a hashcode of this property store using only the specified group names.
+ *
+ * @param groups The names of the property groups to use in the calculation.
+ * @return The hashcode.
+ */
+ public Integer hashCode(String...groups) {
+ HashCode c = new HashCode();
+ for (String p : groups)
+ if (p != null)
+ c.add(p).add(this.groups.get(p));
+ return c.get();
+ }
+
+ @Override /* Object */
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o instanceof PropertyStore)
+ return (this.groups.equals(((PropertyStore)o).groups));
+ return false;
+ }
+
+ /**
+ * Compares two property stores, but only based on the specified group names.
+ *
+ * @param ps The property store to compare to.
+ * @param groups The groups to compare.
+ * @return <jk>true</jk> if the two property stores are equal in the specified groups.
+ */
+ public boolean equals(PropertyStore ps, String...groups) {
+ if (this == ps)
+ return true;
+ for (String p : groups) {
+ if (p != null) {
+ PropertyGroup pg1 = this.groups.get(p), pg2 = ps.groups.get(p);
+ if (pg1 == null && pg2 == null)
+ continue;
+ if (pg1 == null || pg2 == null)
+ return false;
+ if (! pg1.equals(pg2))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Used for debugging.
+ *
+ * <p>
+ * Allows property stores to be serialized to easy-to-read JSON objects.
+ *
+ * @param beanSession The bean session.
+ * @return The property groups.
+ */
+ public Map<String,PropertyGroup> swap(BeanSession beanSession) {
+ return groups;
+ }
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // PropertyGroup
+ //-------------------------------------------------------------------------------------------------------------------
+
+ static class PropertyGroup {
+ final SortedMap<String,Property> properties;
+ private final int hashCode;
+
+ PropertyGroup(Map<String,MutableProperty> properties) {
+ TreeMap<String,Property> m = new TreeMap<>();
+ for (Map.Entry<String,MutableProperty> p : properties.entrySet())
+ m.put(p.getKey(), p.getValue().build());
+ this.properties = Collections.unmodifiableSortedMap(m);
+ this.hashCode = this.properties.hashCode();
+ }
+
+ PropertyGroupBuilder builder() {
+ return new PropertyGroupBuilder(properties);
+ }
+
+ Property get(String key) {
+ return properties.get(key);
+ }
+
+ @Override /* Object */
+ public int hashCode() {
+ return hashCode;
+ }
+
+ @Override /* Object */
+ public boolean equals(Object o) {
+ if (o instanceof PropertyGroup)
+ return properties.equals(((PropertyGroup)o).properties);
+ return false;
+ }
+
+ Set<String> keySet() {
+ return properties.keySet();
+ }
+
+ public Map<String,Property> swap(BeanSession beanSession) {
+ return properties;
+ }
+ }
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Property
+ //-------------------------------------------------------------------------------------------------------------------
+
+ static class Property {
+ private final String name;
+ final Object value;
+ private final int hashCode;
+ private final PropertyType type;
+
+ Property(String name, Object value, PropertyType type) {
+ this.name = name;
+ this.value = value;
+ this.type = type;
+ this.hashCode = value.hashCode();
+ }
+
+ MutableProperty mutable() {
+ switch(type) {
+ case STRING:
+ case BOOLEAN:
+ case INTEGER:
+ case CLASS:
+ case OBJECT: return new MutableSimpleProperty(name, type, value);
+ case SET_STRING:
+ case SET_INTEGER:
+ case SET_CLASS: return new MutableSetProperty(name, type, value);
+ case LIST_STRING:
+ case LIST_INTEGER:
+ case LIST_CLASS:
+ case LIST_OBJECT: return new MutableListProperty(name, type, value);
+ case MAP_STRING:
+ case MAP_INTEGER:
+ case MAP_CLASS:
+ case MAP_OBJECT: return new MutableMapProperty(name, type, value);
+ }
+ throw new ConfigException("Invalid type specified: ''{0}''", type);
+ }
+
+ public <T> T as(Class<T> c) {
+ Class<?> c2 = ClassUtils.getPrimitiveWrapper(c);
+ if (c2 != null)
+ c = (Class<T>)c2;
+ if (c.isInstance(value))
+ return (T)value;
+ if (c.isArray() && value instanceof Collection)
+ return (T)asArray(c.getComponentType());
+ if (type == STRING) {
+ T t = ClassUtils.fromString(c, value.toString());
+ if (t != null)
+ return t;
+ }
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}'' on property ''{2}''", type, c, name);
+ }
+
+ public <T> T[] asArray(Class<T> eType) {
+ if (value instanceof Collection) {
+ Collection<?> l = (Collection<?>)value;
+ Object t = Array.newInstance(eType, l.size());
+ int i = 0;
+ for (Object o : l) {
+ Object o2 = null;
+ if (eType.isInstance(o))
+ o2 = o;
+ else if (type == SET_STRING || type == LIST_STRING) {
+ o2 = ClassUtils.fromString(eType, o.toString());
+ if (o2 == null)
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
+ } else {
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
+ }
+ Array.set(t, i++, o2);
+ }
+ return (T[])t;
+ }
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
+ }
+
+ public <T> Set<T> asSet(Class<T> eType) {
+ if (type == SET_STRING && eType == String.class || type == SET_INTEGER && eType == Integer.class || type == SET_CLASS && eType == Class.class) {
+ return (Set<T>)value;
+ } else if (type == SET_STRING) {
+ Set<T> s = new LinkedHashSet<>();
+ for (Object o : (Set<?>)value) {
+ T t = ClassUtils.fromString(eType, o.toString());
+ if (t == null)
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''Set<{1}>'' on property ''{2}''", type, eType, name);
+ s.add(t);
+ }
+ return Collections.unmodifiableSet(s);
+ } else {
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''Set<{1}>'' on property ''{2}''", type, eType, name);
+ }
+ }
+
+ public <T> List<T> asList(Class<T> eType) {
+ if (type == LIST_STRING && eType == String.class || type == LIST_INTEGER && eType == Integer.class || type == LIST_CLASS && eType == Class.class || type == LIST_OBJECT) {
+ return (List<T>)value;
+ } else if (type == PropertyType.LIST_STRING) {
+ List<T> l = new ArrayList<>();
+ for (Object o : (List<?>)value) {
+ T t = ClassUtils.fromString(eType, o.toString());
+ if (t == null)
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name);
+ l.add(t);
+ }
+ return Collections.unmodifiableList(l);
+ } else {
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name);
+ }
+ }
+
+ public <T> Map<String,T> asMap(Class<T> eType) {
+ if (type == MAP_STRING && eType == String.class || type == MAP_INTEGER && eType == Integer.class || type == MAP_CLASS && eType == Class.class || type == MAP_OBJECT) {
+ return (Map<String,T>)value;
+ } else if (type == MAP_STRING) {
+ Map<String,T> m = new LinkedHashMap<>();
+ for (Map.Entry<String,String> e : ((Map<String,String>)value).entrySet()) {
+ T t = ClassUtils.fromString(eType, e.getValue());
+ if (t == null)
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''Map<String,{1}>'' on property ''{2}''", type, eType, name);
+ m.put(e.getKey(), t);
+ }
+ return Collections.unmodifiableMap(m);
+ } else {
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''Map<String,{1}>'' on property ''{2}''", type, eType, name);
+ }
+ }
+
+ public <T> T asInstance(Class<T> iType) {
+ T t = null;
+ if (type == STRING)
+ t = ClassUtils.fromString(iType, value.toString());
+ else if (type == OBJECT && iType.isInstance(value))
+ t = (T)value;
+ else if (type == CLASS)
+ t = ClassUtils.newInstance(iType, value);
+ if (t != null)
+ return t;
+ throw new ConfigException("Invalid property instantiation ''{0}'' to ''{1}'' on property ''{2}''", type, iType, name);
+ }
+
+ public <T> T[] asInstanceArray(Class<T> eType) {
+ if (value instanceof Collection) {
+ Collection<?> l = (Collection<?>)value;
+ Object t = Array.newInstance(eType, l.size());
+ int i = 0;
+ for (Object o : l) {
+ Object o2 = null;
+ if (eType.isInstance(o))
+ o2 = o;
+ else if (type == SET_STRING || type == LIST_STRING)
+ o2 = ClassUtils.fromString(eType, o.toString());
+ else if (type == SET_CLASS || type == LIST_CLASS)
+ o2 = ClassUtils.newInstance(eType, o);
+ if (o2 == null)
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
+ Array.set(t, i++, o2);
+ }
+ return (T[])t;
+ }
+ throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''", type, eType, name);
+ }
+
+ @Override /* Object */
+ public int hashCode() {
+ return hashCode;
+ }
+
+ @Override /* Object */
+ public boolean equals(Object o) {
+ if (o instanceof Property)
+ return ((Property)o).value.equals(value);
+ return false;
+ }
+
+ public Object swap(BeanSession beanSession) {
+ return value;
+ }
+ }
+
+ //-------------------------------------------------------------------------------------------------------------------
+ // Utility methods
+ //-------------------------------------------------------------------------------------------------------------------
+
+ private static String group(String key) {
+ if (key == null || key.indexOf('.') == -1 || key.charAt(key.length()-1) == '.')
+ throw new ConfigException("Invalid property name specified: ''{0}''", key);
+ String g = key.substring(0, key.indexOf('.'));
+ if (g.isEmpty())
+ throw new ConfigException("Invalid property name specified: ''{0}''", key);
+ return g;
+ }
+
+ @Override /* Object */
+ public String toString() {
+ return JsonSerializer.DEFAULT_LAX.toString(this);
+ }
+}