This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new e81af7e PropertyStore refactoring.
e81af7e is described below
commit e81af7e1119bf71971f7daca17c6376f5fb8c239
Author: JamesBognar <[email protected]>
AuthorDate: Sun Feb 7 14:01:48 2021 -0500
PropertyStore refactoring.
---
.../main/java/org/apache/juneau/config/Config.java | 16 +-
.../juneau/config/store/ConfigFileStore.java | 12 +-
.../java/org/apache/juneau/jena/RdfParser.java | 14 +-
.../java/org/apache/juneau/jena/RdfSerializer.java | 24 +-
.../main/java/org/apache/juneau/BeanContext.java | 60 +--
.../org/apache/juneau/BeanTraverseContext.java | 10 +-
.../src/main/java/org/apache/juneau/Context.java | 424 +--------------------
.../main/java/org/apache/juneau/PropertyStore.java | 15 +
.../org/apache/juneau/html/HtmlDocSerializer.java | 30 +-
.../org/apache/juneau/html/HtmlSerializer.java | 12 +-
.../java/org/apache/juneau/json/JsonParser.java | 2 +-
.../org/apache/juneau/json/JsonSerializer.java | 6 +-
.../juneau/jsonschema/JsonSchemaGenerator.java | 12 +-
.../apache/juneau/msgpack/MsgPackSerializer.java | 2 +-
.../java/org/apache/juneau/oapi/OpenApiParser.java | 4 +-
.../org/apache/juneau/oapi/OpenApiSerializer.java | 4 +-
.../apache/juneau/parser/InputStreamParser.java | 2 +-
.../main/java/org/apache/juneau/parser/Parser.java | 12 +-
.../org/apache/juneau/parser/ReaderParser.java | 4 +-
.../juneau/serializer/OutputStreamSerializer.java | 2 +-
.../org/apache/juneau/serializer/Serializer.java | 24 +-
.../apache/juneau/serializer/WriterSerializer.java | 10 +-
.../org/apache/juneau/soap/SoapXmlSerializer.java | 2 +-
.../main/java/org/apache/juneau/uon/UonParser.java | 4 +-
.../java/org/apache/juneau/uon/UonSerializer.java | 8 +-
.../juneau/urlencoding/UrlEncodingParser.java | 2 +-
.../juneau/urlencoding/UrlEncodingSerializer.java | 2 +-
.../main/java/org/apache/juneau/xml/XmlParser.java | 10 +-
.../java/org/apache/juneau/xml/XmlSerializer.java | 12 +-
.../org/apache/juneau/rest/client/RestClient.java | 48 +--
.../apache/juneau/rest/mock/MockRestClient.java | 9 +-
.../java/org/apache/juneau/rest/RestContext.java | 2 +-
.../org/apache/juneau/rest/RestContextBuilder.java | 9 +-
.../apache/juneau/rest/RestOperationContext.java | 135 ++++---
.../java/org/apache/juneau/ContextCacheTest.java | 6 +-
35 files changed, 282 insertions(+), 668 deletions(-)
diff --git
a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
index 6139656..1b8c6fb 100644
---
a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
+++
b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/Config.java
@@ -446,22 +446,22 @@ public final class Config extends Context implements
ConfigEventListener, Writab
public Config(PropertyStore ps) throws IOException {
super(ps, true);
- name = getStringProperty(CONFIG_name, "Configuration.cfg");
- store = getInstanceProperty(CONFIG_store, ConfigStore.class,
ConfigFileStore.DEFAULT);
+ name = ps.getString(CONFIG_name, "Configuration.cfg");
+ store = ps.getInstance(CONFIG_store, ConfigStore.class,
ConfigFileStore.DEFAULT);
configMap = store.getMap(name);
configMap.register(this);
- serializer = getInstanceProperty(CONFIG_serializer,
WriterSerializer.class, SimpleJsonSerializer.DEFAULT);
- parser = getInstanceProperty(CONFIG_parser, ReaderParser.class,
JsonParser.DEFAULT);
+ serializer = ps.getInstance(CONFIG_serializer,
WriterSerializer.class, SimpleJsonSerializer.DEFAULT);
+ parser = ps.getInstance(CONFIG_parser, ReaderParser.class,
JsonParser.DEFAULT);
beanSession = parser.createBeanSession();
- encoder = getInstanceProperty(CONFIG_encoder,
ConfigEncoder.class, ConfigXorEncoder.INSTANCE);
- varSession = getInstanceProperty(CONFIG_varResolver,
VarResolver.class, VarResolver.DEFAULT)
+ encoder = ps.getInstance(CONFIG_encoder, ConfigEncoder.class,
ConfigXorEncoder.INSTANCE);
+ varSession = ps.getInstance(CONFIG_varResolver,
VarResolver.class, VarResolver.DEFAULT)
.builder()
.vars(ConfigVar.class)
.bean(Config.class, this)
.build()
.createSession();
- binaryLineLength = getIntegerProperty(CONFIG_binaryLineLength);
- binaryFormat = getProperty(CONFIG_binaryFormat,
BinaryFormat.class, BinaryFormat.BASE64);
+ binaryLineLength = ps.getInteger(CONFIG_binaryLineLength);
+ binaryFormat = ps.get(CONFIG_binaryFormat, BinaryFormat.class,
BinaryFormat.BASE64);
multiLineValuesOnSeparateLines =
getBoolean(CONFIG_multiLineValuesOnSeparateLines, false);
readOnly = getBoolean(CONFIG_readOnly, false);
}
diff --git
a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/store/ConfigFileStore.java
b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/store/ConfigFileStore.java
index b791c61..88e34a8 100644
---
a/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/store/ConfigFileStore.java
+++
b/juneau-core/juneau-config/src/main/java/org/apache/juneau/config/store/ConfigFileStore.java
@@ -238,13 +238,13 @@ public class ConfigFileStore extends ConfigStore {
protected ConfigFileStore(PropertyStore ps) {
super(ps);
try {
- dir = new File(getStringProperty(FILESTORE_directory,
".")).getCanonicalFile();
+ dir = new File(ps.getString(FILESTORE_directory,
".")).getCanonicalFile();
dir.mkdirs();
- charset = getProperty(FILESTORE_charset, Charset.class,
Charset.defaultCharset());
- updateOnWrite =
getBooleanProperty(FILESTORE_enableUpdateOnWrite);
- extensions = getCdlProperty(FILESTORE_extensions,
"cfg");
- WatcherSensitivity ws =
getProperty(FILESTORE_watcherSensitivity, WatcherSensitivity.class,
WatcherSensitivity.MEDIUM);
- watcher = getBooleanProperty(FILESTORE_enableWatcher) ?
new WatcherThread(dir, ws) : null;
+ charset = ps.get(FILESTORE_charset, Charset.class,
Charset.defaultCharset());
+ updateOnWrite =
ps.getBoolean(FILESTORE_enableUpdateOnWrite);
+ extensions = ps.getCdl(FILESTORE_extensions, "cfg");
+ WatcherSensitivity ws =
ps.get(FILESTORE_watcherSensitivity, WatcherSensitivity.class,
WatcherSensitivity.MEDIUM);
+ watcher = ps.getBoolean(FILESTORE_enableWatcher) ? new
WatcherThread(dir, ws) : null;
if (watcher != null)
watcher.start();
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 6e02d64..a19a7f3 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
@@ -128,17 +128,17 @@ public class RdfParser extends ReaderParser implements
RdfCommon, RdfMetaProvide
*/
public RdfParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- trimWhitespace = getBooleanProperty(RDF_trimWhitespace);
- looseCollections = getBooleanProperty(RDF_looseCollections);
- rdfLanguage = getStringProperty(RDF_language, "RDF/XML-ABBREV");
- juneauNs = getInstanceProperty(RDF_juneauNs, Namespace.class,
DEFAULT_JUNEAU_NS);
- juneauBpNs = getInstanceProperty(RDF_juneauBpNs,
Namespace.class, DEFAULT_JUNEAUBP_NS);
- collectionFormat = getProperty(RDF_collectionFormat,
RdfCollectionFormat.class, RdfCollectionFormat.DEFAULT);
+ trimWhitespace = ps.getBoolean(RDF_trimWhitespace);
+ looseCollections = ps.getBoolean(RDF_looseCollections);
+ rdfLanguage = ps.getString(RDF_language, "RDF/XML-ABBREV");
+ juneauNs = ps.getInstance(RDF_juneauNs, Namespace.class,
DEFAULT_JUNEAU_NS);
+ juneauBpNs = ps.getInstance(RDF_juneauBpNs, Namespace.class,
DEFAULT_JUNEAUBP_NS);
+ collectionFormat = ps.get(RDF_collectionFormat,
RdfCollectionFormat.class, RdfCollectionFormat.DEFAULT);
ASortedMap<String,Object> m = ASortedMap.create();
for (String k : getPropertyKeys("RdfCommon"))
if (k.startsWith("jena."))
- m.put(k.substring(5), getProperty("RdfCommon."
+ k));
+ m.put(k.substring(5), ps.get("RdfCommon." + k));
jenaProperties = m.unmodifiable();
}
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 4b6265d..dd2affa 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
@@ -290,22 +290,22 @@ public class RdfSerializer extends WriterSerializer
implements RdfCommon, RdfMet
*/
public RdfSerializer(PropertyStore ps, String produces, String accept) {
super(ps, produces, accept);
- addLiteralTypes = getBooleanProperty(RDF_addLiteralTypes);
- addRootProperty = getBooleanProperty(RDF_addRootProperty);
- useXmlNamespaces = !
getBooleanProperty(RDF_disableUseXmlNamespaces);
- looseCollections = getBooleanProperty(RDF_looseCollections);
- autoDetectNamespaces = !
getBooleanProperty(RDF_disableAutoDetectNamespaces);
- rdfLanguage = getStringProperty(RDF_language, "RDF/XML-ABBREV");
- juneauNs = getProperty(RDF_juneauNs, Namespace.class,
DEFAULT_JUNEAU_NS);
- juneauBpNs = getProperty(RDF_juneauBpNs, Namespace.class,
DEFAULT_JUNEAUBP_NS);
- collectionFormat = getProperty(RDF_collectionFormat,
RdfCollectionFormat.class, RdfCollectionFormat.DEFAULT);
- namespaces = getProperty(RDF_namespaces, Namespace[].class, new
Namespace[0]);
- addBeanTypes = getBooleanProperty(RDF_addBeanTypes,
getBooleanProperty(SERIALIZER_addBeanTypes));
+ addLiteralTypes = ps.getBoolean(RDF_addLiteralTypes);
+ addRootProperty = ps.getBoolean(RDF_addRootProperty);
+ useXmlNamespaces = ! ps.getBoolean(RDF_disableUseXmlNamespaces);
+ looseCollections = ps.getBoolean(RDF_looseCollections);
+ autoDetectNamespaces = !
ps.getBoolean(RDF_disableAutoDetectNamespaces);
+ rdfLanguage = ps.getString(RDF_language, "RDF/XML-ABBREV");
+ juneauNs = ps.get(RDF_juneauNs, Namespace.class,
DEFAULT_JUNEAU_NS);
+ juneauBpNs = ps.get(RDF_juneauBpNs, Namespace.class,
DEFAULT_JUNEAUBP_NS);
+ collectionFormat = ps.get(RDF_collectionFormat,
RdfCollectionFormat.class, RdfCollectionFormat.DEFAULT);
+ namespaces = ps.get(RDF_namespaces, Namespace[].class, new
Namespace[0]);
+ addBeanTypes = ps.getBoolean(RDF_addBeanTypes,
ps.getBoolean(SERIALIZER_addBeanTypes));
ASortedMap<String,Object> m = ASortedMap.create();
for (String k : getPropertyKeys("RdfCommon"))
if (k.startsWith("jena."))
- m.put(k.substring(5), getProperty("RdfCommon."
+ k));
+ m.put(k.substring(5), ps.get("RdfCommon." + k));
jenaProperties = m.unmodifiable();
}
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 7bfcc3d..b93ec9d 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
@@ -2110,36 +2110,36 @@ public class BeanContext extends Context implements
MetaProvider {
}
this.annotations = rmb.build();
- beansRequireDefaultConstructor =
getBooleanProperty(BEAN_beansRequireDefaultConstructor);
- beansRequireSerializable =
getBooleanProperty(BEAN_beansRequireSerializable);
- beansRequireSettersForGetters =
getBooleanProperty(BEAN_beansRequireSettersForGetters);
- beansRequireSomeProperties = !
getBooleanProperty(BEAN_disableBeansRequireSomeProperties);
- beanMapPutReturnsOldValue =
getBooleanProperty(BEAN_beanMapPutReturnsOldValue);
- useEnumNames = getBooleanProperty(BEAN_useEnumNames);
- useInterfaceProxies = !
getBooleanProperty(BEAN_disableInterfaceProxies);
- ignoreUnknownBeanProperties =
getBooleanProperty(BEAN_ignoreUnknownBeanProperties);
- ignoreUnknownNullBeanProperties = !
getBooleanProperty(BEAN_disableIgnoreUnknownNullBeanProperties);
- ignoreMissingSetters = !
getBooleanProperty(BEAN_disableIgnoreMissingSetters);
- ignoreTransientFields = !
getBooleanProperty(BEAN_disableIgnoreTransientFields);
- ignoreInvocationExceptionsOnGetters =
getBooleanProperty(BEAN_ignoreInvocationExceptionsOnGetters);
- ignoreInvocationExceptionsOnSetters =
getBooleanProperty(BEAN_ignoreInvocationExceptionsOnSetters);
- useJavaBeanIntrospector =
getBooleanProperty(BEAN_useJavaBeanIntrospector);
- sortProperties = getBooleanProperty(BEAN_sortProperties);
- findFluentSetters = getBooleanProperty(BEAN_findFluentSetters);
- typePropertyName = getStringProperty(BEAN_typePropertyName,
"_type");
-
- beanConstructorVisibility =
getProperty(BEAN_beanConstructorVisibility, Visibility.class, PUBLIC);
- beanClassVisibility = getProperty(BEAN_beanClassVisibility,
Visibility.class, PUBLIC);
- beanMethodVisibility = getProperty(BEAN_beanMethodVisibility,
Visibility.class, PUBLIC);
- beanFieldVisibility = getProperty(BEAN_beanFieldVisibility,
Visibility.class, PUBLIC);
-
- notBeanClasses = getClassArrayProperty(BEAN_notBeanClasses,
DEFAULT_NOTBEAN_CLASSES);
-
- propertyNamer = getInstanceProperty(BEAN_propertyNamer,
PropertyNamer.class, BasicPropertyNamer.class);
+ beansRequireDefaultConstructor =
ps.getBoolean(BEAN_beansRequireDefaultConstructor);
+ beansRequireSerializable =
ps.getBoolean(BEAN_beansRequireSerializable);
+ beansRequireSettersForGetters =
ps.getBoolean(BEAN_beansRequireSettersForGetters);
+ beansRequireSomeProperties = !
ps.getBoolean(BEAN_disableBeansRequireSomeProperties);
+ beanMapPutReturnsOldValue =
ps.getBoolean(BEAN_beanMapPutReturnsOldValue);
+ useEnumNames = ps.getBoolean(BEAN_useEnumNames);
+ useInterfaceProxies = !
ps.getBoolean(BEAN_disableInterfaceProxies);
+ ignoreUnknownBeanProperties =
ps.getBoolean(BEAN_ignoreUnknownBeanProperties);
+ ignoreUnknownNullBeanProperties = !
ps.getBoolean(BEAN_disableIgnoreUnknownNullBeanProperties);
+ ignoreMissingSetters = !
ps.getBoolean(BEAN_disableIgnoreMissingSetters);
+ ignoreTransientFields = !
ps.getBoolean(BEAN_disableIgnoreTransientFields);
+ ignoreInvocationExceptionsOnGetters =
ps.getBoolean(BEAN_ignoreInvocationExceptionsOnGetters);
+ ignoreInvocationExceptionsOnSetters =
ps.getBoolean(BEAN_ignoreInvocationExceptionsOnSetters);
+ useJavaBeanIntrospector =
ps.getBoolean(BEAN_useJavaBeanIntrospector);
+ sortProperties = ps.getBoolean(BEAN_sortProperties);
+ findFluentSetters = ps.getBoolean(BEAN_findFluentSetters);
+ typePropertyName = ps.getString(BEAN_typePropertyName, "_type");
+
+ beanConstructorVisibility =
ps.get(BEAN_beanConstructorVisibility, Visibility.class, PUBLIC);
+ beanClassVisibility = ps.get(BEAN_beanClassVisibility,
Visibility.class, PUBLIC);
+ beanMethodVisibility = ps.get(BEAN_beanMethodVisibility,
Visibility.class, PUBLIC);
+ beanFieldVisibility = ps.get(BEAN_beanFieldVisibility,
Visibility.class, PUBLIC);
+
+ notBeanClasses = ps.getClassArray(BEAN_notBeanClasses,
DEFAULT_NOTBEAN_CLASSES);
+
+ propertyNamer = ps.getInstance(BEAN_propertyNamer,
PropertyNamer.class, BasicPropertyNamer.class);
List<String> l1 = new LinkedList<>();
List<String> l2 = new LinkedList<>();
- for (String s : getArrayProperty(BEAN_notBeanPackages,
String.class, DEFAULT_NOTBEAN_PACKAGES)) {
+ for (String s : ps.getArray(BEAN_notBeanPackages, String.class,
DEFAULT_NOTBEAN_PACKAGES)) {
if (s.endsWith(".*"))
l2.add(s.substring(0, s.length()-2));
else
@@ -2149,7 +2149,7 @@ public class BeanContext extends Context implements
MetaProvider {
notBeanPackagePrefixes = l2.toArray(new String[l2.size()]);
LinkedList<PojoSwap<?,?>> lpf = new LinkedList<>();
- for (Object o : getListProperty(BEAN_swaps, Object.class)) {
+ for (Object o : ps.getList(BEAN_swaps, Object.class)) {
if (o instanceof Class) {
ClassInfo ci = ClassInfo.of((Class<?>)o);
if (ci.isChildOf(PojoSwap.class))
@@ -2175,7 +2175,7 @@ public class BeanContext extends Context implements
MetaProvider {
cmObject = cmCache.get(Object.class);
cmClass = cmCache.get(Class.class);
- beanDictionaryClasses =
AList.unmodifiable(getClassArrayProperty(BEAN_beanDictionary));
+ beanDictionaryClasses =
AList.unmodifiable(ps.getClassArray(BEAN_beanDictionary, new Class[0]));
beanRegistry = new BeanRegistry(this, null);
}
@@ -3538,7 +3538,7 @@ public class BeanContext extends Context implements
MetaProvider {
public OMap toMap() {
return super.toMap()
.a(
- "BeanContext",
+ "BeanContext",
OMap
.create()
.filtered()
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanTraverseContext.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanTraverseContext.java
index dc9dfff..1163bee 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanTraverseContext.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanTraverseContext.java
@@ -271,10 +271,10 @@ public abstract class BeanTraverseContext extends
BeanContext {
protected BeanTraverseContext(PropertyStore ps) {
super(ps);
- maxDepth = getIntegerProperty(BEANTRAVERSE_maxDepth, 100);
- initialDepth = getIntegerProperty(BEANTRAVERSE_initialDepth, 0);
- ignoreRecursions =
getBooleanProperty(BEANTRAVERSE_ignoreRecursions);
- detectRecursions =
getBooleanProperty(BEANTRAVERSE_detectRecursions, ignoreRecursions);
+ maxDepth = ps.getInteger(BEANTRAVERSE_maxDepth, 100);
+ initialDepth = ps.getInteger(BEANTRAVERSE_initialDepth, 0);
+ ignoreRecursions = ps.getBoolean(BEANTRAVERSE_ignoreRecursions);
+ detectRecursions = ps.getBoolean(BEANTRAVERSE_detectRecursions,
ignoreRecursions);
}
@Override /* Context */
@@ -351,7 +351,7 @@ public abstract class BeanTraverseContext extends
BeanContext {
public OMap toMap() {
return super.toMap()
.a(
- "BeanTraverseContext",
+ "BeanTraverseContext",
OMap
.create()
.filtered()
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 2cfec6c..71bf075 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
@@ -12,12 +12,10 @@
//
***************************************************************************************************************************
package org.apache.juneau;
-import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
-import org.apache.juneau.cp.*;
import org.apache.juneau.http.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.json.*;
@@ -340,423 +338,13 @@ public abstract class Context {
* @param allowReuse If <jk>true</jk>, subclasses that share the same
property store values can be reused.
*/
public Context(PropertyStore ps, boolean allowReuse) {
- this.propertyStore = ps == null ? PropertyStore.DEFAULT : ps;
+ propertyStore = ps == null ? PropertyStore.DEFAULT : ps;
+ ps = propertyStore;
this.identityCode = allowReuse ? new
HashCode().add(getClass().getName()).add(ps).get() :
System.identityHashCode(this);
- debug = getBooleanProperty(CONTEXT_debug);
- locale = getInstanceProperty(CONTEXT_locale, Locale.class,
Locale.getDefault());
- timeZone = getInstanceProperty(CONTEXT_timeZone,
TimeZone.class);
- mediaType = getInstanceProperty(CONTEXT_mediaType,
MediaType.class);
- }
-
- /**
- * 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) {
- return propertyStore.get(key);
- }
-
- /**
- * 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 final <T> T getProperty(String key, Class<T> c, T def) {
- return propertyStore.get(key, c, def);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, Boolean.<jk>class</jk>,
def)</code>.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public final Boolean getBooleanProperty(String key, Boolean def) {
- return propertyStore.getBoolean(key, def);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, Boolean.<jk>class</jk>,
<jk>false</jk>)</code>.
- *
- * @param key The property name.
- * @return The property value, or <jk>false</jk> if it doesn't exist.
- */
- public final boolean getBooleanProperty(String key) {
- return propertyStore.getBoolean(key);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, Integer.<jk>class</jk>,
def)</code>.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public final Integer getIntegerProperty(String key, Integer def) {
- return propertyStore.getInteger(key, def);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, Integer.<jk>class</jk>,
-1)</code>.
- *
- * @param key The property name.
- * @return The property value, or <c>-1</c> if it doesn't exist.
- */
- public final int getIntegerProperty(String key) {
- return propertyStore.getInteger(key);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, Long.<jk>class</jk>,
def)</code>.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public final Long getLongProperty(String key, Long def) {
- return propertyStore.getLong(key, def);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, Long.<jk>class</jk>,
-1)</code>.
- *
- * @param key The property name.
- * @return The property value, or <c>-1</c> if it doesn't exist.
- */
- public final long getLongProperty(String key) {
- return propertyStore.getLong(key);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, String.<jk>class</jk>,
def)</code>.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public final String getStringProperty(String key, String def) {
- return propertyStore.getString(key, def);
- }
-
- /**
- * Shortcut for calling <code>getProperty(key, String.<jk>class</jk>,
<jk>null</jk>)</code>.
- *
- * @param key The property name.
- * @return The property value, or the <jk>null</jk> if it doesn't exist.
- */
- public final String getStringProperty(String key) {
- return propertyStore.getString(key);
- }
-
- /**
- * Returns a property as a parsed comma-delimited list of strings.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public final String[] getCdlProperty(String key, String def) {
- return propertyStore.getCdl(key, def);
- }
-
- /**
- * Same as {@link #getStringProperty(String, String)} but returns a
blank instead of the default value if it resolves to <js>"NONE"</js>.
- *
- * @param key The property name.
- * @param def The default value.
- * @return The property value, or the default value if it doesn't exist.
- */
- public final String getStringPropertyWithNone(String key, String def) {
- return propertyStore.getNoneableString(key, def);
- }
-
- /**
- * 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 final <T> Class<? extends T> getClassProperty(String key,
Class<T> type, Class<? extends T> def) {
- return propertyStore.getClass(key, type, def);
- }
-
- /**
- * Returns the class property with the specified name.
- *
- * @param key The property name.
- * @param type The class type of the property.
- * @return The property value, or <jk>null</jk> if it doesn't exist.
- */
- public final <T> Class<? extends T> getClassProperty(String key,
Class<T> type) {
- return propertyStore.getClass(key, type);
- }
-
- /**
- * 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 final <T> T[] getArrayProperty(String key, Class<T> eType) {
- return propertyStore.getArray(key, 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 the default value if it doesn't exist.
- */
- public final <T> T[] getArrayProperty(String key, Class<T> eType, T[]
def) {
- return propertyStore.getArray(key, eType, def);
- }
-
- /**
- * 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 final Class<?>[] getClassArrayProperty(String key) {
- return propertyStore.getClass(key);
- }
-
- /**
- * 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 final Class<?>[] getClassArrayProperty(String key, Class<?>[]
def) {
- return propertyStore.getClassArray(key, def);
- }
-
- /**
- * 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 final <T> Class<T>[] getClassArrayProperty(String key, Class<T>
eType) {
- return propertyStore.getClassArray(key, eType);
- }
-
- /**
- * 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 <c>LinkedHashSet</c>,
or an empty set if it doesn't exist.
- */
- public final <T> Set<T> getSetProperty(String key, Class<T> eType) {
- return propertyStore.getSet(key, eType);
- }
-
- /**
- * Returns the set property 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 if the property doesn't exist or is
empty.
- * @return The property value as an unmodifiable <c>LinkedHashSet</c>,
or the default value if it doesn't exist or is empty.
- */
- public final <T> Set<T> getSetProperty(String key, Class<T> eType,
Set<T> def) {
- return propertyStore.getSet(key, eType, def);
- }
-
- /**
- * Returns the class set property with the specified name.
- *
- * @param key The property name.
- * @return The property value as an unmodifiable <c>LinkedHashSet</c>,
or an empty set if it doesn't exist.
- */
- public final Set<Class<?>> getClassSetProperty(String key) {
- return propertyStore.getClassSet(key);
- }
-
- /**
- * 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 <c>LinkedHashSet</c>,
or an empty set if it doesn't exist.
- */
- public final <T> Set<Class<T>> getClassSetProperty(String key, Class<T>
eType) {
- return propertyStore.getClassSet(key, eType);
- }
-
- /**
- * 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 <c>ArrayList</c>, or
an empty list if it doesn't exist.
- */
- public final <T> List<T> getListProperty(String key, Class<T> eType) {
- return propertyStore.getList(key, eType);
- }
-
- /**
- * Returns the list property 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 if the property doesn't exist or is
empty.
- * @return The property value as an unmodifiable <c>ArrayList</c>, or
the default value if it doesn't exist or is empty.
- */
- public final <T> List<T> getListProperty(String key, Class<T> eType,
List<T> def) {
- return propertyStore.getList(key, eType, def);
- }
-
- /**
- * Returns the class list property with the specified name.
- *
- * @param key The property name.
- * @return The property value as an unmodifiable <c>ArrayList</c>, or
an empty list if it doesn't exist.
- */
- public final List<Class<?>> getClassListProperty(String key) {
- return propertyStore.getClassList(key);
- }
-
- /**
- * 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 <c>ArrayList</c>, or
an empty list if it doesn't exist.
- */
- public final <T> List<Class<T>> getClassListProperty(String key,
Class<T> eType) {
- return propertyStore.getClassList(key, eType);
- }
-
- /**
- * 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 <c>LinkedHashMap</c>,
or an empty map if it doesn't exist.
- */
- public final <T> Map<String,T> getMapProperty(String key, Class<T>
eType) {
- return propertyStore.getMap(key, eType);
- }
-
- /**
- * Returns the class map property with the specified name.
- *
- * @param key The property name.
- * @return The property value as an unmodifiable <c>LinkedHashMap</c>,
or an empty map if it doesn't exist.
- */
- public final Map<String,Class<?>> getClassMapProperty(String key) {
- return propertyStore.getClassMap(key);
- }
-
- /**
- * 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 <c>LinkedHashMap</c>,
or an empty map if it doesn't exist.
- */
- public final <T> Map<String,Class<T>> getClassMapProperty(String key,
Class<T> eType) {
- return propertyStore.getClassMap(key, eType);
- }
-
- /**
- * Returns an instance of the specified class, string, or object
property.
- *
- * <p>
- * If instantiating a class, assumes the class has a no-arg constructor.
- * Otherwise, throws a runtime exception.
- *
- * @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 <c>T</c>, or a
<code>Class<? <jk>extends</jk> T></code>, or <jk>null</jk>.
- * @return A new property instance.
- */
- public <T> T getInstanceProperty(String key, Class<T> type, Object def)
{
- return propertyStore.getInstance(key, type, def);
- }
-
- /**
- * Returns an instance of the specified class, string, or object
property.
- *
- * <p>
- * If instantiating a class, assumes the class has a no-arg constructor.
- * Otherwise, throws a runtime exception.
- *
- * @param key The property name.
- * @param type The class type of the property.
- * @return A new property instance or <jk>null</jk> if the property
doesn't exist.
- */
- public <T> T getInstanceProperty(String key, Class<T> type) {
- return getInstanceProperty(key, type, null);
- }
-
- /**
- * Returns an instance of the specified class, string, or object
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 <c>T</c>, or a
<code>Class<? <jk>extends</jk> T></code>.
- * @param beanFactory The bean factory to use to instantiate beans.
- * @return A new property instance.
- */
- public <T> T getInstanceProperty(String key, Class<T> type, Object def,
BeanFactory beanFactory) {
- return propertyStore.getInstance(key, type, def, beanFactory);
- }
-
- /**
- * 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) {
- return propertyStore.getInstanceArray(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.
- * @return A new property instance, or an empty array if it doesn't
exist.
- */
- @SuppressWarnings("unchecked")
- public <T> T[] getInstanceArrayProperty(String key, Class<T> type) {
- return propertyStore.getInstanceArray(key, type,
(T[])Array.newInstance(type, 0));
- }
-
- /**
- * 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.
- * @param beanFactory The bean factory to use for instantiating beans.
- * @return A new property instance.
- */
- public <T> T[] getInstanceArrayProperty(String key, Class<T> type, T[]
def, BeanFactory beanFactory) {
- return propertyStore.getInstanceArray(key, type, def,
beanFactory);
+ debug = ps.getBoolean(CONTEXT_debug);
+ locale = ps.getInstance(CONTEXT_locale, Locale.class,
Locale.getDefault());
+ timeZone = ps.getInstance(CONTEXT_timeZone, TimeZone.class);
+ mediaType = ps.getInstance(CONTEXT_mediaType, MediaType.class);
}
/**
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
index c9202e7..b996166 100644
---
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
@@ -643,6 +643,21 @@ public final class PropertyStore {
/**
* Returns an instance of the specified class, string, or object
property.
*
+ * <p>
+ * If instantiating a class, assumes the class has a no-arg constructor.
+ * Otherwise, throws a runtime exception.
+ *
+ * @param key The property name.
+ * @param type The class type of the property.
+ * @return A new property instance or <jk>null</jk> if the property
doesn't exist.
+ */
+ public <T> T getInstance(String key, Class<T> type) {
+ return getInstance(key, type, null);
+ }
+
+ /**
+ * Returns an instance of the specified class, string, or object
property.
+ *
* @param key The property name.
* @param type The class type of the property.
* @param def
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 e92e873..ed67442 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
@@ -763,22 +763,22 @@ public class HtmlDocSerializer extends
HtmlStrippedDocSerializer {
*/
public HtmlDocSerializer(PropertyStore ps, String produces, String
accept) {
super(ps, produces, accept);
- style = getArrayProperty(HTMLDOC_style, String.class);
- stylesheet = getArrayProperty(HTMLDOC_stylesheet, String.class);
- script = getArrayProperty(HTMLDOC_script, String.class);
- head = getArrayProperty(HTMLDOC_head, String.class);
- header = getArrayProperty(HTMLDOC_header, String.class);
- nav = getArrayProperty(HTMLDOC_nav, String.class);
- aside = getArrayProperty(HTMLDOC_aside, String.class);
- asideFloat = getProperty(HTMLDOC_asideFloat, AsideFloat.class,
AsideFloat.RIGHT);
- footer = getArrayProperty(HTMLDOC_footer, String.class);
- nowrap = getBooleanProperty(HTMLDOC_nowrap);
- navlinks = getArrayProperty(HTMLDOC_navlinks, String.class);
- noResultsMessage = getStringProperty(HTMLDOC_noResultsMessage,
"<p>no results</p>");
- template = getInstanceProperty(HTMLDOC_template,
HtmlDocTemplate.class, BasicHtmlDocTemplate.class);
+ style = ps.getArray(HTMLDOC_style, String.class);
+ stylesheet = ps.getArray(HTMLDOC_stylesheet, String.class);
+ script = ps.getArray(HTMLDOC_script, String.class);
+ head = ps.getArray(HTMLDOC_head, String.class);
+ header = ps.getArray(HTMLDOC_header, String.class);
+ nav = ps.getArray(HTMLDOC_nav, String.class);
+ aside = ps.getArray(HTMLDOC_aside, String.class);
+ asideFloat = ps.get(HTMLDOC_asideFloat, AsideFloat.class,
AsideFloat.RIGHT);
+ footer = ps.getArray(HTMLDOC_footer, String.class);
+ nowrap = ps.getBoolean(HTMLDOC_nowrap);
+ navlinks = ps.getArray(HTMLDOC_navlinks, String.class);
+ noResultsMessage = ps.getString(HTMLDOC_noResultsMessage,
"<p>no results</p>");
+ template = ps.getInstance(HTMLDOC_template,
HtmlDocTemplate.class, BasicHtmlDocTemplate.class);
widgets = new HtmlWidgetMap();
- widgets.append(getInstanceArrayProperty(HTMLDOC_widgets,
HtmlWidget.class));
+ widgets.append(ps.getInstanceArray(HTMLDOC_widgets,
HtmlWidget.class));
}
@Override /* Context */
@@ -985,7 +985,7 @@ public class HtmlDocSerializer extends
HtmlStrippedDocSerializer {
public OMap toMap() {
return super.toMap()
.a(
- "HtmlDocSerializer",
+ "HtmlDocSerializer",
OMap
.create()
.filtered()
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 0659f8e..3b39c0c 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
@@ -715,12 +715,12 @@ public class HtmlSerializer extends XmlSerializer
implements HtmlMetaProvider, H
*/
public HtmlSerializer(PropertyStore ps, String produces, String accept)
{
super(ps, produces, accept);
- uriAnchorText = getProperty(HTML_uriAnchorText,
AnchorText.class, AnchorText.TO_STRING);
- detectLabelParameters = !
getBooleanProperty(HTML_disableDetectLabelParameters);
- detectLinksInStrings = !
getBooleanProperty(HTML_disableDetectLinksInStrings);
- labelParameter = getStringProperty(HTML_labelParameter,
"label");
- addKeyValueTableHeaders =
getBooleanProperty(HTML_addKeyValueTableHeaders);
- addBeanTypes = getBooleanProperty(HTML_addBeanTypes,
getBooleanProperty(SERIALIZER_addBeanTypes));
+ uriAnchorText = ps.get(HTML_uriAnchorText, AnchorText.class,
AnchorText.TO_STRING);
+ detectLabelParameters = !
ps.getBoolean(HTML_disableDetectLabelParameters);
+ detectLinksInStrings = !
ps.getBoolean(HTML_disableDetectLinksInStrings);
+ labelParameter = ps.getString(HTML_labelParameter, "label");
+ addKeyValueTableHeaders =
ps.getBoolean(HTML_addKeyValueTableHeaders);
+ addBeanTypes = ps.getBoolean(HTML_addBeanTypes,
ps.getBoolean(SERIALIZER_addBeanTypes));
}
@Override /* Context */
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 f0dc16d..bb09131 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
@@ -215,7 +215,7 @@ public class JsonParser extends ReaderParser implements
JsonMetaProvider, JsonCo
*/
public JsonParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- validateEnd = getBooleanProperty(JSON_validateEnd);
+ validateEnd = ps.getBoolean(JSON_validateEnd);
}
@Override /* Context */
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 bd92ba1..b948956 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
@@ -378,9 +378,9 @@ public class JsonSerializer extends WriterSerializer
implements JsonMetaProvider
public JsonSerializer(PropertyStore ps, String produces, String accept)
{
super(ps, produces, accept);
- simpleMode = getBooleanProperty(JSON_simpleMode);
- escapeSolidus = getBooleanProperty(JSON_escapeSolidus);
- addBeanTypes = getBooleanProperty(JSON_addBeanTypes,
getBooleanProperty(SERIALIZER_addBeanTypes));
+ simpleMode = ps.getBoolean(JSON_simpleMode);
+ escapeSolidus = ps.getBoolean(JSON_escapeSolidus);
+ addBeanTypes = ps.getBoolean(JSON_addBeanTypes,
ps.getBoolean(SERIALIZER_addBeanTypes));
}
@Override /* Context */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
index 2a85f7c..57a094b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
@@ -318,12 +318,12 @@ public class JsonSchemaGenerator extends
BeanTraverseContext implements JsonSche
public JsonSchemaGenerator(PropertyStore ps) {
super(ps.builder().setDefault(BEANTRAVERSE_detectRecursions,
true).setDefault(BEANTRAVERSE_ignoreRecursions, true).build());
- useBeanDefs = getBooleanProperty(JSONSCHEMA_useBeanDefs);
- allowNestedExamples =
getBooleanProperty(JSONSCHEMA_allowNestedExamples);
- allowNestedDescriptions =
getBooleanProperty(JSONSCHEMA_allowNestedDescriptions);
- beanDefMapper = getInstanceProperty(JSONSCHEMA_beanDefMapper,
BeanDefMapper.class, BasicBeanDefMapper.class);
- addExamplesTo =
TypeCategory.parse(getStringProperty(JSONSCHEMA_addExamplesTo));
- addDescriptionsTo =
TypeCategory.parse(getStringProperty(JSONSCHEMA_addDescriptionsTo));
+ useBeanDefs = ps.getBoolean(JSONSCHEMA_useBeanDefs);
+ allowNestedExamples =
ps.getBoolean(JSONSCHEMA_allowNestedExamples);
+ allowNestedDescriptions =
ps.getBoolean(JSONSCHEMA_allowNestedDescriptions);
+ beanDefMapper = ps.getInstance(JSONSCHEMA_beanDefMapper,
BeanDefMapper.class, BasicBeanDefMapper.class);
+ addExamplesTo =
TypeCategory.parse(ps.getString(JSONSCHEMA_addExamplesTo));
+ addDescriptionsTo =
TypeCategory.parse(ps.getString(JSONSCHEMA_addDescriptionsTo));
Set<Pattern> ignoreTypes = new LinkedHashSet<>();
for (String s : split(ps.get(JSONSCHEMA_ignoreTypes,
String.class, "")))
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 207ccf9..5224b2a 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
@@ -135,7 +135,7 @@ public class MsgPackSerializer extends
OutputStreamSerializer implements MsgPack
*/
public MsgPackSerializer(PropertyStore ps) {
super(ps, "octal/msgpack", null);
- this.addBeanTypes = getBooleanProperty(MSGPACK_addBeanTypes,
getBooleanProperty(SERIALIZER_addBeanTypes));
+ this.addBeanTypes = ps.getBoolean(MSGPACK_addBeanTypes,
ps.getBoolean(SERIALIZER_addBeanTypes));
}
@Override /* Context */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
index 693a7a9..f1da291 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
@@ -75,8 +75,8 @@ public class OpenApiParser extends UonParser implements
OpenApiMetaProvider, Ope
*/
public OpenApiParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- format = getProperty(OAPI_format, HttpPartFormat.class,
HttpPartFormat.NO_FORMAT);
- collectionFormat = getProperty(OAPI_collectionFormat,
HttpPartCollectionFormat.class, HttpPartCollectionFormat.NO_COLLECTION_FORMAT);
+ format = ps.get(OAPI_format, HttpPartFormat.class,
HttpPartFormat.NO_FORMAT);
+ collectionFormat = ps.get(OAPI_collectionFormat,
HttpPartCollectionFormat.class, HttpPartCollectionFormat.NO_COLLECTION_FORMAT);
}
@Override /* Context */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
index 651982e..3c8c19a 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
@@ -90,8 +90,8 @@ public class OpenApiSerializer extends UonSerializer
implements OpenApiMetaProvi
produces,
accept
);
- format = getProperty(OAPI_format, HttpPartFormat.class,
HttpPartFormat.NO_FORMAT);
- collectionFormat = getProperty(OAPI_collectionFormat,
HttpPartCollectionFormat.class, HttpPartCollectionFormat.NO_COLLECTION_FORMAT);
+ format = ps.get(OAPI_format, HttpPartFormat.class,
HttpPartFormat.NO_FORMAT);
+ collectionFormat = ps.get(OAPI_collectionFormat,
HttpPartCollectionFormat.class, HttpPartCollectionFormat.NO_COLLECTION_FORMAT);
}
/**
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 9b242f1..c1dd00b 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
@@ -106,7 +106,7 @@ public abstract class InputStreamParser extends Parser {
*/
protected InputStreamParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- binaryFormat = getProperty(ISPARSER_binaryFormat,
BinaryFormat.class, BinaryFormat.HEX);
+ binaryFormat = ps.get(ISPARSER_binaryFormat,
BinaryFormat.class, BinaryFormat.HEX);
}
@Override /* Parser */
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 b864e76..8990121 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
@@ -539,12 +539,12 @@ public abstract class Parser extends BeanContext {
protected Parser(PropertyStore ps, String...consumes) {
super(ps);
- trimStrings = getBooleanProperty(PARSER_trimStrings);
- strict = getBooleanProperty(PARSER_strict);
- autoCloseStreams = getBooleanProperty(PARSER_autoCloseStreams);
- debugOutputLines = getIntegerProperty(PARSER_debugOutputLines,
5);
- unbuffered = getBooleanProperty(PARSER_unbuffered);
- listener = getClassProperty(PARSER_listener,
ParserListener.class);
+ trimStrings = ps.getBoolean(PARSER_trimStrings);
+ strict = ps.getBoolean(PARSER_strict);
+ autoCloseStreams = ps.getBoolean(PARSER_autoCloseStreams);
+ debugOutputLines = ps.getInteger(PARSER_debugOutputLines, 5);
+ unbuffered = ps.getBoolean(PARSER_unbuffered);
+ listener = ps.getClass(PARSER_listener, ParserListener.class);
this.consumes = new MediaType[consumes.length];
for (int i = 0; i < consumes.length; i++) {
this.consumes[i] = MediaType.of(consumes[i]);
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 becc24d..b42459d 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
@@ -164,8 +164,8 @@ public abstract class ReaderParser extends Parser {
protected ReaderParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- streamCharset = getProperty(RPARSER_streamCharset,
Charset.class, IOUtils.UTF8);
- fileCharset = getProperty(RPARSER_fileCharset, Charset.class,
Charset.defaultCharset());
+ streamCharset = ps.get(RPARSER_streamCharset, Charset.class,
IOUtils.UTF8);
+ fileCharset = ps.get(RPARSER_fileCharset, Charset.class,
Charset.defaultCharset());
}
@Override /* Parser */
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 d92d602..ef0b951 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
@@ -122,7 +122,7 @@ public abstract class OutputStreamSerializer extends
Serializer {
protected OutputStreamSerializer(PropertyStore ps, String produces,
String accept) {
super(ps, produces, accept);
- binaryFormat = getProperty(OSSERIALIZER_binaryFormat,
BinaryFormat.class, BinaryFormat.HEX);
+ binaryFormat = ps.get(OSSERIALIZER_binaryFormat,
BinaryFormat.class, BinaryFormat.HEX);
}
//-----------------------------------------------------------------------------------------------------------------
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 f1afd84..a79b897 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
@@ -826,18 +826,18 @@ public abstract class Serializer extends
BeanTraverseContext {
protected Serializer(PropertyStore ps, String produces, String accept) {
super(ps);
- addBeanTypes = getBooleanProperty(SERIALIZER_addBeanTypes);
- keepNullProperties =
getBooleanProperty(SERIALIZER_keepNullProperties);
- trimEmptyCollections =
getBooleanProperty(SERIALIZER_trimEmptyCollections);
- trimEmptyMaps = getBooleanProperty(SERIALIZER_trimEmptyMaps);
- trimStrings = getBooleanProperty(SERIALIZER_trimStrings);
- sortCollections =
getBooleanProperty(SERIALIZER_sortCollections);
- sortMaps = getBooleanProperty(SERIALIZER_sortMaps);
- addRootType = getBooleanProperty(SERIALIZER_addRootType);
- uriContext = getProperty(SERIALIZER_uriContext,
UriContext.class, UriContext.DEFAULT);
- uriResolution = getProperty(SERIALIZER_uriResolution,
UriResolution.class, UriResolution.NONE);
- uriRelativity = getProperty(SERIALIZER_uriRelativity,
UriRelativity.class, UriRelativity.RESOURCE);
- listener = getClassProperty(SERIALIZER_listener,
SerializerListener.class);
+ addBeanTypes = ps.getBoolean(SERIALIZER_addBeanTypes);
+ keepNullProperties =
ps.getBoolean(SERIALIZER_keepNullProperties);
+ trimEmptyCollections =
ps.getBoolean(SERIALIZER_trimEmptyCollections);
+ trimEmptyMaps = ps.getBoolean(SERIALIZER_trimEmptyMaps);
+ trimStrings = ps.getBoolean(SERIALIZER_trimStrings);
+ sortCollections = ps.getBoolean(SERIALIZER_sortCollections);
+ sortMaps = ps.getBoolean(SERIALIZER_sortMaps);
+ addRootType = ps.getBoolean(SERIALIZER_addRootType);
+ uriContext = ps.get(SERIALIZER_uriContext, UriContext.class,
UriContext.DEFAULT);
+ uriResolution = ps.get(SERIALIZER_uriResolution,
UriResolution.class, UriResolution.NONE);
+ uriRelativity = ps.get(SERIALIZER_uriRelativity,
UriRelativity.class, UriRelativity.RESOURCE);
+ listener = ps.getClass(SERIALIZER_listener,
SerializerListener.class);
this.produces = MediaType.of(produces);
this.accept = accept == null ? MediaRanges.of(produces) :
MediaRanges.of(accept);
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 013fe13..f548ea2 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
@@ -339,11 +339,11 @@ public abstract class WriterSerializer extends Serializer
{
protected WriterSerializer(PropertyStore ps, String produces, String
accept) {
super(ps, produces, accept);
- maxIndent = getIntegerProperty(WSERIALIZER_maxIndent, 100);
- quoteChar = getStringProperty(WSERIALIZER_quoteChar,
"\"").charAt(0);
- streamCharset = getProperty(WSERIALIZER_streamCharset,
Charset.class, IOUtils.UTF8);
- fileCharset = getProperty(WSERIALIZER_fileCharset,
Charset.class, Charset.defaultCharset());
- useWhitespace = getBooleanProperty(WSERIALIZER_useWhitespace);
+ maxIndent = ps.getInteger(WSERIALIZER_maxIndent, 100);
+ quoteChar = ps.getString(WSERIALIZER_quoteChar, "\"").charAt(0);
+ streamCharset = ps.get(WSERIALIZER_streamCharset,
Charset.class, IOUtils.UTF8);
+ fileCharset = ps.get(WSERIALIZER_fileCharset, Charset.class,
Charset.defaultCharset());
+ useWhitespace = ps.getBoolean(WSERIALIZER_useWhitespace);
}
//-----------------------------------------------------------------------------------------------------------------
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 7be9dd7..289ac74 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
@@ -82,7 +82,7 @@ public final class SoapXmlSerializer extends XmlSerializer
implements SoapXmlMet
*/
public SoapXmlSerializer(PropertyStore ps) {
super(ps, "text/xml", "text/xml+soap");
- soapAction = getStringProperty(SOAPXML_SOAPAction,
"http://www.w3.org/2003/05/soap-envelope");
+ soapAction = ps.getString(SOAPXML_SOAPAction,
"http://www.w3.org/2003/05/soap-envelope");
}
@Override /* Context */
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 d22c4cf..d8a4764 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
@@ -257,8 +257,8 @@ public class UonParser extends ReaderParser implements
HttpPartParser, UonMetaPr
*/
public UonParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- this.decoding = getBooleanProperty(UON_decoding);
- this.validateEnd = getBooleanProperty(UON_validateEnd);
+ this.decoding = ps.getBoolean(UON_decoding);
+ this.validateEnd = ps.getBoolean(UON_validateEnd);
}
@Override /* Context */
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 ade8186..29d3310 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
@@ -411,10 +411,10 @@ public class UonSerializer extends WriterSerializer
implements HttpPartSerialize
*/
public UonSerializer(PropertyStore ps, String produces, String accept) {
super(ps, produces, accept);
- encoding = getBooleanProperty(UON_encoding);
- addBeanTypes = getBooleanProperty(UON_addBeanTypes,
getBooleanProperty(SERIALIZER_addBeanTypes));
- paramFormat = getProperty(UON_paramFormat, ParamFormat.class,
ParamFormat.UON);
- quoteChar = getStringProperty(WSERIALIZER_quoteChar,
"'").charAt(0);
+ encoding = ps.getBoolean(UON_encoding);
+ addBeanTypes = ps.getBoolean(UON_addBeanTypes,
ps.getBoolean(SERIALIZER_addBeanTypes));
+ paramFormat = ps.get(UON_paramFormat, ParamFormat.class,
ParamFormat.UON);
+ quoteChar = ps.getString(WSERIALIZER_quoteChar, "'").charAt(0);
}
@Override /* Context */
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 2811c55..52279e7 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
@@ -134,7 +134,7 @@ public class UrlEncodingParser extends UonParser implements
UrlEncodingMetaProvi
.build(),
"application/x-www-form-urlencoded"
);
- expandedParams = getBooleanProperty(URLENC_expandedParams);
+ expandedParams = ps.getBoolean(URLENC_expandedParams);
}
@Override /* Context */
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 f92640b..0058e43 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
@@ -306,7 +306,7 @@ public class UrlEncodingSerializer extends UonSerializer
implements UrlEncodingM
produces,
accept
);
- expandedParams = getBooleanProperty(URLENC_expandedParams);
+ expandedParams = ps.getBoolean(URLENC_expandedParams);
}
@Override /* Context */
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 4149f81..b0013b1 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
@@ -252,11 +252,11 @@ public class XmlParser extends ReaderParser implements
XmlMetaProvider, XmlCommo
*/
public XmlParser(PropertyStore ps, String...consumes) {
super(ps, consumes);
- validating = getBooleanProperty(XML_validating);
- preserveRootElement =
getBooleanProperty(XML_preserveRootElement);
- reporter = getInstanceProperty(XML_reporter, XMLReporter.class);
- resolver = getInstanceProperty(XML_resolver, XMLResolver.class);
- eventAllocator = getInstanceProperty(XML_eventAllocator,
XMLEventAllocator.class);
+ validating = ps.getBoolean(XML_validating);
+ preserveRootElement = ps.getBoolean(XML_preserveRootElement);
+ reporter = ps.getInstance(XML_reporter, XMLReporter.class);
+ resolver = ps.getInstance(XML_resolver, XMLResolver.class);
+ eventAllocator = ps.getInstance(XML_eventAllocator,
XMLEventAllocator.class);
}
@Override /* Context */
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 9aec6d9..bf4658b 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
@@ -513,12 +513,12 @@ public class XmlSerializer extends WriterSerializer
implements XmlMetaProvider,
*/
public XmlSerializer(PropertyStore ps, String produces, String accept) {
super(ps, produces, accept);
- autoDetectNamespaces = !
getBooleanProperty(XML_disableAutoDetectNamespaces);
- enableNamespaces = getBooleanProperty(XML_enableNamespaces);
- addNamespaceUrlsToRoot =
getBooleanProperty(XML_addNamespaceUrisToRoot);
- defaultNamespace = getInstanceProperty(XML_defaultNamespace,
Namespace.class, DEFAULT_JUNEAU_NAMESPACE);
- addBeanTypes = getBooleanProperty(XML_addBeanTypes,
getBooleanProperty(SERIALIZER_addBeanTypes));
- namespaces = getInstanceArrayProperty(XML_namespaces,
Namespace.class);
+ autoDetectNamespaces = !
ps.getBoolean(XML_disableAutoDetectNamespaces);
+ enableNamespaces = ps.getBoolean(XML_enableNamespaces);
+ addNamespaceUrlsToRoot =
ps.getBoolean(XML_addNamespaceUrisToRoot);
+ defaultNamespace = ps.getInstance(XML_defaultNamespace,
Namespace.class, DEFAULT_JUNEAU_NAMESPACE);
+ addBeanTypes = ps.getBoolean(XML_addBeanTypes,
ps.getBoolean(SERIALIZER_addBeanTypes));
+ namespaces = ps.getInstanceArray(XML_namespaces,
Namespace.class);
}
@Override /* Context */
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 95988a6..48cd566 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
@@ -2037,23 +2037,23 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
@SuppressWarnings("unchecked")
protected RestClient(PropertyStore ps) {
super(ps);
- this.httpClient = getInstanceProperty(RESTCLIENT_httpClient,
CloseableHttpClient.class);
- this.connectionManager =
getInstanceProperty(RESTCLIENT_connectionManager,
HttpClientConnectionManager.class);
- this.keepHttpClientOpen =
getBooleanProperty(RESTCLIENT_keepHttpClientOpen);
- this.errorCodes = getInstanceProperty(RESTCLIENT_errorCodes,
Predicate.class, ERROR_CODES_DEFAULT);
- this.executorServiceShutdownOnClose =
getBooleanProperty(RESTCLIENT_executorServiceShutdownOnClose);
- this.rootUri =
StringUtils.nullIfEmpty(getStringProperty(RESTCLIENT_rootUri,
"").replaceAll("\\/$", ""));
- this.leakDetection =
getBooleanProperty(RESTCLIENT_leakDetection, isDebug());
- this.ignoreErrors = getBooleanProperty(RESTCLIENT_ignoreErrors);
- this.logger = getInstanceProperty(RESTCLIENT_logger,
Logger.class, Logger.getLogger(RestClient.class.getName()));
- this.logRequests = getInstanceProperty(RESTCLIENT_logRequests,
DetailLevel.class, isDebug() ? DetailLevel.FULL : DetailLevel.NONE);
- this.logRequestsLevel =
getInstanceProperty(RESTCLIENT_logRequestsLevel, Level.class, isDebug() ?
Level.WARNING : Level.OFF);
- this.logToConsole = getBooleanProperty(RESTCLIENT_logToConsole,
isDebug());
- this.console = getInstanceProperty(RESTCLIENT_console,
PrintStream.class, System.err);
- this.logRequestsPredicate =
getInstanceProperty(RESTCLIENT_logRequestsPredicate, BiPredicate.class,
LOG_REQUESTS_PREDICATE_DEFAULT);
+ this.httpClient = ps.getInstance(RESTCLIENT_httpClient,
CloseableHttpClient.class);
+ this.connectionManager =
ps.getInstance(RESTCLIENT_connectionManager, HttpClientConnectionManager.class);
+ this.keepHttpClientOpen =
ps.getBoolean(RESTCLIENT_keepHttpClientOpen);
+ this.errorCodes = ps.getInstance(RESTCLIENT_errorCodes,
Predicate.class, ERROR_CODES_DEFAULT);
+ this.executorServiceShutdownOnClose =
ps.getBoolean(RESTCLIENT_executorServiceShutdownOnClose);
+ this.rootUri =
StringUtils.nullIfEmpty(ps.getString(RESTCLIENT_rootUri, "").replaceAll("\\/$",
""));
+ this.leakDetection = ps.getBoolean(RESTCLIENT_leakDetection,
isDebug());
+ this.ignoreErrors = ps.getBoolean(RESTCLIENT_ignoreErrors);
+ this.logger = ps.getInstance(RESTCLIENT_logger, Logger.class,
Logger.getLogger(RestClient.class.getName()));
+ this.logRequests = ps.getInstance(RESTCLIENT_logRequests,
DetailLevel.class, isDebug() ? DetailLevel.FULL : DetailLevel.NONE);
+ this.logRequestsLevel =
ps.getInstance(RESTCLIENT_logRequestsLevel, Level.class, isDebug() ?
Level.WARNING : Level.OFF);
+ this.logToConsole = ps.getBoolean(RESTCLIENT_logToConsole,
isDebug());
+ this.console = ps.getInstance(RESTCLIENT_console,
PrintStream.class, System.err);
+ this.logRequestsPredicate =
ps.getInstance(RESTCLIENT_logRequestsPredicate, BiPredicate.class,
LOG_REQUESTS_PREDICATE_DEFAULT);
SerializerGroupBuilder sgb = SerializerGroup.create();
- for (Object o : getArrayProperty(RESTCLIENT_serializers,
Object.class)) {
+ for (Object o : ps.getArray(RESTCLIENT_serializers,
Object.class)) {
if (o instanceof Serializer) {
sgb.append((Serializer)o); // Don't apply
PropertyStore.
} else if (o instanceof Class) {
@@ -2068,7 +2068,7 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
this.serializers = sgb.build();
ParserGroupBuilder pgb = ParserGroup.create();
- for (Object o : getArrayProperty(RESTCLIENT_parsers,
Object.class)) {
+ for (Object o : ps.getArray(RESTCLIENT_parsers, Object.class)) {
if (o instanceof Parser) {
pgb.append((Parser)o); // Don't apply
PropertyStore.
} else if (o instanceof Class) {
@@ -2087,14 +2087,14 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
.addBean(RestClient.class, this);
this.urlEncodingSerializer = new
SerializerBuilder(ps).build(UrlEncodingSerializer.class);
- this.partSerializer =
getInstanceProperty(RESTCLIENT_partSerializer, HttpPartSerializer.class,
OpenApiSerializer.class, beanFactory);
- this.partParser = getInstanceProperty(RESTCLIENT_partParser,
HttpPartParser.class, OpenApiParser.class, beanFactory);
- this.executorService =
getInstanceProperty(RESTCLIENT_executorService, ExecutorService.class, null);
+ this.partSerializer = ps.getInstance(RESTCLIENT_partSerializer,
HttpPartSerializer.class, OpenApiSerializer.class, beanFactory);
+ this.partParser = ps.getInstance(RESTCLIENT_partParser,
HttpPartParser.class, OpenApiParser.class, beanFactory);
+ this.executorService =
ps.getInstance(RESTCLIENT_executorService, ExecutorService.class, null);
HttpPartSerializerSession partSerializerSession =
partSerializer.createPartSession(null);
this.headers = HeaderSupplier.create();
- for (Object o : getListProperty(RESTCLIENT_headers,
Object.class)) {
+ for (Object o : ps.getList(RESTCLIENT_headers, Object.class)) {
o = buildBuilders(o, partSerializerSession);
if (o instanceof HeaderSupplier)
headers.add((HeaderSupplier)o);
@@ -2103,7 +2103,7 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
}
this.query = NameValuePairSupplier.create();
- for (Object o : getListProperty(RESTCLIENT_query,
Object.class)) {
+ for (Object o : ps.getList(RESTCLIENT_query, Object.class)) {
o = buildBuilders(o, partSerializerSession);
if (o instanceof NameValuePairSupplier)
query.add((NameValuePairSupplier)o);
@@ -2112,7 +2112,7 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
}
this.formData = NameValuePairSupplier.create();
- for (Object o : getListProperty(RESTCLIENT_formData,
Object.class)) {
+ for (Object o : ps.getList(RESTCLIENT_formData, Object.class)) {
o = buildBuilders(o, partSerializerSession);
if (o instanceof NameValuePairSupplier)
formData.add((NameValuePairSupplier)o);
@@ -2120,9 +2120,9 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
formData.add(BasicNameValuePair.cast(o));
}
- this.callHandler = getInstanceProperty(RESTCLIENT_callHandler,
RestCallHandler.class, BasicRestCallHandler.class, beanFactory);
+ this.callHandler = ps.getInstance(RESTCLIENT_callHandler,
RestCallHandler.class, BasicRestCallHandler.class, beanFactory);
- this.interceptors =
getInstanceArrayProperty(RESTCLIENT_interceptors, RestCallInterceptor.class);
+ this.interceptors =
ps.getInstanceArray(RESTCLIENT_interceptors, RestCallInterceptor.class);
creationStack = isDebug() ?
Thread.currentThread().getStackTrace() : null;
}
diff --git
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
index db43665..abb3d09 100644
---
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
+++
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
@@ -254,11 +254,12 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
*/
public MockRestClient(PropertyStore ps) {
super(preInit(ps));
- this.restBeanCtx =
getInstanceProperty(MOCKRESTCLIENT_restBeanCtx, RestContext.class);
+ ps = getPropertyStore();
+ this.restBeanCtx = ps.getInstance(MOCKRESTCLIENT_restBeanCtx,
RestContext.class);
this.restObject = restBeanCtx.getResource();
- this.contextPath =
getStringProperty(MOCKRESTCLIENT_contextPath, "");
- this.servletPath =
getStringProperty(MOCKRESTCLIENT_servletPath, "");
- this.pathVars = getMapProperty(MOCKRESTCLIENT_pathVars,
String.class);
+ this.contextPath = ps.getString(MOCKRESTCLIENT_contextPath, "");
+ this.servletPath = ps.getString(MOCKRESTCLIENT_servletPath, "");
+ this.pathVars = ps.getMap(MOCKRESTCLIENT_pathVars,
String.class);
HttpClientConnectionManager ccm =
getHttpClientConnectionManager();
if (ccm instanceof MockHttpClientConnectionManager)
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 c77d8e5..53e5d22 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
@@ -5635,7 +5635,7 @@ public class RestContext extends BeanContext {
.implClass(properties.getClass(REST_restChildrenClass,
RestChildren.class));
// Initialize our child resources.
- for (Object o : getArrayProperty(REST_children, Object.class)) {
+ for (Object o : properties.getArray(REST_children,
Object.class)) {
String path = null;
if (o instanceof RestChild) {
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
index 6e1fa3b..800d53a 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
@@ -134,10 +134,11 @@ public class RestContextBuilder extends
BeanContextBuilder implements ServletCon
// Pass-through default values.
if (parentContext.isPresent()) {
RestContext pc = parentContext.get();
- set(REST_callLoggerDefault,
pc.getProperty(REST_callLoggerDefault));
- set(REST_debugDefault,
pc.getProperty(REST_debugDefault));
- set(REST_staticFilesDefault,
pc.getProperty(REST_staticFilesDefault));
- set(REST_fileFinderDefault,
pc.getProperty(REST_fileFinderDefault));
+ PropertyStore pcps = pc.getPropertyStore();
+ set(REST_callLoggerDefault,
pcps.get(REST_callLoggerDefault));
+ set(REST_debugDefault,
pcps.get(REST_debugDefault));
+ set(REST_staticFilesDefault,
pcps.get(REST_staticFilesDefault));
+ set(REST_fileFinderDefault,
pcps.get(REST_fileFinderDefault));
}
beanFactory = createBeanFactory(parentContext,
resource);
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
index 3bfa299..110bbdb 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
@@ -681,7 +681,6 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
private final RestConverter[] converters;
private final Integer priority;
private final RestContext context;
- private final BeanFactory beanFactory;
final Method method;
final MethodInvoker methodInvoker;
final MethodInfo mi;
@@ -740,52 +739,52 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
mi = MethodInfo.of(method).accessible();
Object r = context.getResource();
- beanFactory = BeanFactory.of(context.rootBeanFactory, r)
+ BeanFactory bf =
BeanFactory.of(context.rootBeanFactory, r)
.addBean(RestOperationContext.class, this)
.addBean(Method.class, method)
.addBean(PropertyStore.class, ps);
- beanFactory.addBean(BeanFactory.class, beanFactory);
+ bf.addBean(BeanFactory.class, bf);
- serializers = createSerializers(r, beanFactory, ps);
- beanFactory.addBean(SerializerGroup.class, serializers);
+ serializers = createSerializers(r, bf, ps);
+ bf.addBean(SerializerGroup.class, serializers);
- parsers = createParsers(r, beanFactory, ps);
- beanFactory.addBean(ParserGroup.class, parsers);
+ parsers = createParsers(r, bf, ps);
+ bf.addBean(ParserGroup.class, parsers);
- partSerializer = createPartSerializer(r, beanFactory,
ps);
- beanFactory.addBean(HttpPartSerializer.class,
partSerializer);
+ partSerializer = createPartSerializer(r, bf, ps);
+ bf.addBean(HttpPartSerializer.class, partSerializer);
- partParser = createPartParser(r, beanFactory, ps);
- beanFactory.addBean(HttpPartParser.class, partParser);
+ partParser = createPartParser(r, bf, ps);
+ bf.addBean(HttpPartParser.class, partParser);
- converters = createConverters(r, beanFactory).asArray();
- beanFactory.addBean(RestConverter[].class, converters);
+ converters = createConverters(r, ps, bf).asArray();
+ bf.addBean(RestConverter[].class, converters);
- guards = createGuards(r, beanFactory).asArray();
- beanFactory.addBean(RestGuard[].class, guards);
+ guards = createGuards(r, ps, bf).asArray();
+ bf.addBean(RestGuard[].class, guards);
- RestMatcherList matchers = createMatchers(r,
beanFactory);
+ RestMatcherList matchers = createMatchers(r, ps, bf);
requiredMatchers = matchers.stream().filter(x ->
x.required()).toArray(RestMatcher[]::new);
optionalMatchers = matchers.stream().filter(x -> !
x.required()).toArray(RestMatcher[]::new);
- pathMatchers = createPathMatchers(r,
beanFactory).asArray();
- beanFactory.addBean(UrlPathMatcher[].class,
pathMatchers);
- beanFactory.addBean(UrlPathMatcher.class,
pathMatchers.length > 0 ? pathMatchers[0] : null);
+ pathMatchers = createPathMatchers(r, ps, bf).asArray();
+ bf.addBean(UrlPathMatcher[].class, pathMatchers);
+ bf.addBean(UrlPathMatcher.class, pathMatchers.length >
0 ? pathMatchers[0] : null);
- encoders = createEncoders(r, beanFactory);
- beanFactory.addBean(EncoderGroup.class, encoders);
+ encoders = createEncoders(r, ps, bf);
+ bf.addBean(EncoderGroup.class, encoders);
- jsonSchemaGenerator = createJsonSchemaGenerator(r,
beanFactory, ps);
- beanFactory.addBean(JsonSchemaGenerator.class,
jsonSchemaGenerator);
+ jsonSchemaGenerator = createJsonSchemaGenerator(r, bf,
ps);
+ bf.addBean(JsonSchemaGenerator.class,
jsonSchemaGenerator);
- supportedAcceptTypes = getListProperty(REST_produces,
MediaType.class, serializers.getSupportedMediaTypes());
- supportedContentTypes = getListProperty(REST_consumes,
MediaType.class, parsers.getSupportedMediaTypes());
+ supportedAcceptTypes = ps.getList(REST_produces,
MediaType.class, serializers.getSupportedMediaTypes());
+ supportedContentTypes = ps.getList(REST_consumes,
MediaType.class, parsers.getSupportedMediaTypes());
- defaultRequestHeaders = createDefaultRequestHeaders(r,
beanFactory, method, context).asArray();
- defaultResponseHeaders =
createDefaultResponseHeaders(r, beanFactory, method, context).asArray();
- defaultRequestQuery = createDefaultRequestQuery(r,
beanFactory, method).asArray();
- defaultRequestFormData =
createDefaultRequestFormData(r, beanFactory, method).asArray();
- defaultRequestAttributes =
createDefaultRequestAttributes(r, beanFactory, method, context).asArray();
+ defaultRequestHeaders = createDefaultRequestHeaders(r,
ps, bf, method, context).asArray();
+ defaultResponseHeaders =
createDefaultResponseHeaders(r, ps, bf, method, context).asArray();
+ defaultRequestQuery = createDefaultRequestQuery(r, ps,
bf, method).asArray();
+ defaultRequestFormData =
createDefaultRequestFormData(r, ps, bf, method).asArray();
+ defaultRequestAttributes =
createDefaultRequestAttributes(r, ps, bf, method, context).asArray();
int _hierarchyDepth = 0;
Class<?> sc =
method.getDeclaringClass().getSuperclass();
@@ -795,22 +794,22 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
}
hierarchyDepth = _hierarchyDepth;
- String _httpMethod = getProperty(RESTOP_httpMethod,
String.class, null);
+ String _httpMethod = ps.get(RESTOP_httpMethod,
String.class, null);
if (_httpMethod == null)
_httpMethod =
HttpUtils.detectHttpMethod(method, true, "GET");
if ("METHOD".equals(_httpMethod))
_httpMethod = "*";
httpMethod = _httpMethod.toUpperCase(Locale.ENGLISH);
- defaultCharset = getProperty(REST_defaultCharset,
String.class, "utf-8");
+ defaultCharset = ps.get(REST_defaultCharset,
String.class, "utf-8");
- maxInput =
StringUtils.parseLongWithSuffix(getProperty(REST_maxInput, String.class,
"100M"));
+ maxInput =
StringUtils.parseLongWithSuffix(ps.get(REST_maxInput, String.class, "100M"));
responseMeta = ResponseBeanMeta.create(mi, ps);
- opParams = context.findRestOperationParams(mi.inner(),
beanFactory);
+ opParams = context.findRestOperationParams(mi.inner(),
bf);
- this.priority = getIntegerProperty(RESTOP_priority, 0);
+ this.priority = ps.getInteger(RESTOP_priority, 0);
this.callLogger = context.getCallLogger();
} catch (ServletException e) {
@@ -868,16 +867,17 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* </ul>
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @return The result converters for this REST resource method.
* @throws Exception If result converters could not be instantiated.
* @seealso #REST_converters
*/
- protected RestConverterList createConverters(Object resource,
BeanFactory beanFactory) throws Exception {
+ protected RestConverterList createConverters(Object resource,
PropertyStore properties, BeanFactory beanFactory) throws Exception {
RestConverterList x = RestConverterList.create();
- x.append(getInstanceArrayProperty(REST_converters,
RestConverter.class, new RestConverter[0], beanFactory));
+ x.append(properties.getInstanceArray(REST_converters,
RestConverter.class, new RestConverter[0], beanFactory));
if (x.isEmpty())
x =
beanFactory.getBean(RestConverterList.class).orElse(x);
@@ -919,22 +919,23 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* </ul>
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @return The guards for this REST resource method.
* @throws Exception If guards could not be instantiated.
* @seealso #REST_guards
*/
- protected RestGuardList createGuards(Object resource, BeanFactory
beanFactory) throws Exception {
+ protected RestGuardList createGuards(Object resource, PropertyStore
properties, BeanFactory beanFactory) throws Exception {
RestGuardList x = RestGuardList.create();
- x.append(getInstanceArrayProperty(REST_guards, RestGuard.class,
new RestGuard[0], beanFactory));
+ x.append(properties.getInstanceArray(REST_guards,
RestGuard.class, new RestGuard[0], beanFactory));
if (x.isEmpty())
x = beanFactory.getBean(RestGuardList.class).orElse(x);
- Set<String> rolesDeclared = getSetProperty(REST_rolesDeclared,
String.class, null);
- Set<String> roleGuard = getSetProperty(REST_roleGuard,
String.class, Collections.emptySet());
+ Set<String> rolesDeclared =
properties.getSet(REST_rolesDeclared, String.class, null);
+ Set<String> roleGuard = properties.getSet(REST_roleGuard,
String.class, Collections.emptySet());
for (String rg : roleGuard) {
try {
@@ -979,21 +980,22 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* </ul>
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @return The method matchers for this REST resource method.
* @throws Exception If method matchers could not be instantiated.
* @seealso #RESTMETHOD_matchers
*/
- protected RestMatcherList createMatchers(Object resource, BeanFactory
beanFactory) throws Exception {
+ protected RestMatcherList createMatchers(Object resource, PropertyStore
properties, BeanFactory beanFactory) throws Exception {
RestMatcherList x = RestMatcherList.create();
- x.append(getInstanceArrayProperty(RESTOP_matchers,
RestMatcher.class, new RestMatcher[0], beanFactory));
+ x.append(properties.getInstanceArray(RESTOP_matchers,
RestMatcher.class, new RestMatcher[0], beanFactory));
if (x.isEmpty())
x =
beanFactory.getBean(RestMatcherList.class).orElse(x);
- String clientVersion = getProperty(RESTOP_clientVersion,
String.class, null);
+ String clientVersion = properties.get(RESTOP_clientVersion,
String.class, null);
if (clientVersion != null)
x.add(new
ClientVersionMatcher(context.getClientVersionHeader(), mi));
@@ -1033,14 +1035,15 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* </ul>
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @return The encoders for this REST resource method.
* @throws Exception If encoders could not be instantiated.
* @seealso #REST_encoders
*/
- protected EncoderGroup createEncoders(Object resource, BeanFactory
beanFactory) throws Exception {
+ protected EncoderGroup createEncoders(Object resource, PropertyStore
properties, BeanFactory beanFactory) throws Exception {
- Encoder[] x = getInstanceArrayProperty(REST_encoders,
Encoder.class, null, beanFactory);
+ Encoder[] x = properties.getInstanceArray(REST_encoders,
Encoder.class, null, beanFactory);
if (x == null)
x = beanFactory.getBean(Encoder[].class).orElse(null);
@@ -1100,7 +1103,7 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
SerializerGroup g =
beanFactory.getBean(SerializerGroup.class).orElse(null);
if (g == null) {
- Object[] x = getArrayProperty(REST_serializers,
Object.class);
+ Object[] x = ps.getArray(REST_serializers,
Object.class);
if (x == null)
x =
beanFactory.getBean(Serializer[].class).orElse(null);
@@ -1161,7 +1164,7 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
ParserGroup g =
beanFactory.getBean(ParserGroup.class).orElse(null);
if (g == null) {
- Object[] x = getArrayProperty(REST_parsers,
Object.class);
+ Object[] x = ps.getArray(REST_parsers, Object.class);
if (x == null)
x =
beanFactory.getBean(Parser[].class).orElse(null);
@@ -1226,7 +1229,7 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
x = (HttpPartSerializer)resource;
if (x == null)
- x = getInstanceProperty(REST_partSerializer,
HttpPartSerializer.class, null, beanFactory);
+ x = ps.getInstance(REST_partSerializer,
HttpPartSerializer.class, null, beanFactory);
if (x == null)
x =
beanFactory.getBean(HttpPartSerializer.class).orElse(null);
@@ -1284,7 +1287,7 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
x = (HttpPartParser)resource;
if (x == null)
- x = getInstanceProperty(REST_partParser,
HttpPartParser.class, null, beanFactory);
+ x = ps.getInstance(REST_partParser,
HttpPartParser.class, null, beanFactory);
if (x == null)
x =
beanFactory.getBean(HttpPartParser.class).orElse(null);
@@ -1308,17 +1311,18 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* Instantiates the path matchers for this method.
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @return The HTTP part parser for this REST resource.
* @throws Exception If parser could not be instantiated.
* @seealso #RESTMETHOD_paths
*/
- protected UrlPathMatcherList createPathMatchers(Object resource,
BeanFactory beanFactory) throws Exception {
+ protected UrlPathMatcherList createPathMatchers(Object resource,
PropertyStore properties, BeanFactory beanFactory) throws Exception {
UrlPathMatcherList x = UrlPathMatcherList.create();
- boolean dotAll =
getBooleanProperty("RestOperationContext.dotAll.b", false);
+ boolean dotAll =
properties.getBoolean("RestOperationContext.dotAll.b", false);
- for (String p : getArrayProperty(RESTOP_path, String.class)) {
+ for (String p : properties.getArray(RESTOP_path, String.class))
{
if (dotAll && ! p.endsWith("/*"))
p += "/*";
x.add(UrlPathMatcher.of(p));
@@ -1380,19 +1384,20 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* Instantiates the default request headers for this method.
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @param method This Java method.
* @param context The REST class context.
* @return The default request headers for this method.
* @throws Exception If default request headers could not be
instantiated.
*/
- protected HeaderList createDefaultRequestHeaders(Object resource,
BeanFactory beanFactory, Method method, RestContext context) throws Exception {
+ protected HeaderList createDefaultRequestHeaders(Object resource,
PropertyStore properties, BeanFactory beanFactory, Method method, RestContext
context) throws Exception {
HeaderList x = HeaderList.create();
x.appendUnique(context.defaultRequestHeaders);
-
x.appendUnique(getInstanceArrayProperty(RESTOP_defaultRequestHeaders,
org.apache.http.Header.class, new org.apache.http.Header[0], beanFactory));
+
x.appendUnique(properties.getInstanceArray(RESTOP_defaultRequestHeaders,
org.apache.http.Header.class, new org.apache.http.Header[0], beanFactory));
for (Annotation[] aa : method.getParameterAnnotations()) {
for (Annotation a : aa) {
@@ -1425,19 +1430,20 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* Instantiates the default request headers for this method.
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @param method This Java method.
* @param context The REST class context.
* @return The default request headers for this method.
* @throws Exception If default request headers could not be
instantiated.
*/
- protected HeaderList createDefaultResponseHeaders(Object resource,
BeanFactory beanFactory, Method method, RestContext context) throws Exception {
+ protected HeaderList createDefaultResponseHeaders(Object resource,
PropertyStore properties, BeanFactory beanFactory, Method method, RestContext
context) throws Exception {
HeaderList x = HeaderList.create();
x.appendUnique(context.defaultResponseHeaders);
-
x.appendUnique(getInstanceArrayProperty(RESTOP_defaultResponseHeaders,
org.apache.http.Header.class, new org.apache.http.Header[0], beanFactory));
+
x.appendUnique(properties.getInstanceArray(RESTOP_defaultResponseHeaders,
org.apache.http.Header.class, new org.apache.http.Header[0], beanFactory));
x = BeanFactory
.of(beanFactory, resource)
@@ -1454,18 +1460,19 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* Instantiates the default request attributes for this method.
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @param method This Java method.
* @param context The REST class context.
* @return The default request attributes for this method.
* @throws Exception If default request headers could not be
instantiated.
*/
- protected NamedAttributeList createDefaultRequestAttributes(Object
resource, BeanFactory beanFactory, Method method, RestContext context) throws
Exception {
+ protected NamedAttributeList createDefaultRequestAttributes(Object
resource, PropertyStore properties, BeanFactory beanFactory, Method method,
RestContext context) throws Exception {
NamedAttributeList x = NamedAttributeList.create();
x.appendUnique(context.defaultRequestAttributes);
-
x.appendUnique(getInstanceArrayProperty(RESTOP_defaultRequestAttributes,
NamedAttribute.class, new NamedAttribute[0], beanFactory));
+
x.appendUnique(properties.getInstanceArray(RESTOP_defaultRequestAttributes,
NamedAttribute.class, new NamedAttribute[0], beanFactory));
x = BeanFactory
.of(beanFactory, resource)
@@ -1482,16 +1489,17 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* Instantiates the default query parameters for this method.
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @param method This Java method.
* @return The default request query parameters for this method.
* @throws Exception If default request query parameters could not be
instantiated.
*/
- protected NameValuePairList createDefaultRequestQuery(Object resource,
BeanFactory beanFactory, Method method) throws Exception {
+ protected NameValuePairList createDefaultRequestQuery(Object resource,
PropertyStore properties, BeanFactory beanFactory, Method method) throws
Exception {
NameValuePairList x = NameValuePairList.create();
- x.appendUnique(getInstanceArrayProperty(RESTOP_defaultQuery,
NameValuePair.class, new NameValuePair[0], beanFactory));
+ x.appendUnique(properties.getInstanceArray(RESTOP_defaultQuery,
NameValuePair.class, new NameValuePair[0], beanFactory));
for (Annotation[] aa : method.getParameterAnnotations()) {
for (Annotation a : aa) {
@@ -1525,16 +1533,17 @@ public class RestOperationContext extends BeanContext
implements Comparable<Rest
* Instantiates the default form-data parameters for this method.
*
* @param resource The REST resource object.
+ * @param properties xxx
* @param beanFactory The bean factory to use for retrieving and
creating beans.
* @param method This Java method.
* @return The default request form-data parameters for this method.
* @throws Exception If default request form-data parameters could not
be instantiated.
*/
- protected NameValuePairList createDefaultRequestFormData(Object
resource, BeanFactory beanFactory, Method method) throws Exception {
+ protected NameValuePairList createDefaultRequestFormData(Object
resource, PropertyStore properties, BeanFactory beanFactory, Method method)
throws Exception {
NameValuePairList x = NameValuePairList.create();
- x.appendUnique(getInstanceArrayProperty(RESTOP_defaultFormData,
NameValuePair.class, new NameValuePair[0], beanFactory));
+
x.appendUnique(properties.getInstanceArray(RESTOP_defaultFormData,
NameValuePair.class, new NameValuePair[0], beanFactory));
for (Annotation[] aa : method.getParameterAnnotations()) {
for (Annotation a : aa) {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/ContextCacheTest.java
b/juneau-utest/src/test/java/org/apache/juneau/ContextCacheTest.java
index c700664..b3bd351 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/ContextCacheTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/ContextCacheTest.java
@@ -132,7 +132,7 @@ public class ContextCacheTest {
public A(PropertyStore ps) {
super(ps, true);
- f1 = getStringProperty("A.f1", "xxx");
+ f1 = getPropertyStore().getString("A.f1", "xxx");
}
@Override
@@ -157,7 +157,7 @@ public class ContextCacheTest {
public B(PropertyStore ps) {
super(ps);
- f2 = getIntegerProperty("B.f2.i");
+ f2 = getPropertyStore().getInteger("B.f2.i");
}
@@ -172,7 +172,7 @@ public class ContextCacheTest {
public boolean f3;
public C(PropertyStore ps) {
super(ps);
- f3 = getBooleanProperty("C.f3.b");
+ f3 = getPropertyStore().getBoolean("C.f3.b");
}
@Override