public class Settings extends Object
Default BeanIO settings can be overridden using a property file named beanio.properties The file will be loaded from the current working directory or from anywhere on the classpath. The default configuration filename can be overridden using the System property org.beanio.configuration.
Configuration settings can be further overridden by any System property of the same name when the configuration file is loaded.
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_PROTECTED_PROPERTY_ACCESS
Whether non-public fields and methods may be made accessible.
|
static String |
CREATE_MISSING_BEANS
Whether version 2.0.0 style unmarshalling should be supported which instantiates bean objects
for missing fields and records during unmarshalling.
|
static String |
DEFAULT_DATE_FORMAT
The default date format pattern for fields assigned type alias Date
|
static String |
DEFAULT_DATETIME_FORMAT
The default date format pattern for fields assigned type alias DateTime or of type java.util.Date
|
static String |
DEFAULT_FIELD_MIN_OCCURS
The default minOccurs setting for a field (after appending the stream format)
|
static String |
DEFAULT_GROUP_MIN_OCCURS
The default minOccurs setting for a group.
|
static String |
DEFAULT_LOCALE
The default locale used by type handlers
|
static String |
DEFAULT_MARSHALLING_ENABLED
Whether a configured field default is marshalled for null property values.
|
static String |
DEFAULT_RECORD_MIN_OCCURS
The default minOccurs setting for a record.
|
static String |
DEFAULT_TIME_FORMAT
The default date format pattern for fields assigned type alias Time
|
static String |
DEFAULT_XML_TYPE
The default XML type for a field definition, set to element or attribute.
|
static String |
DEFAULT_XSI_NAMESPACE_PREFIX
The default namespace prefix for 'http://www.w3.org/2001/XMLSchema-instance'
|
static String |
ERROR_IF_NULL_PRIMITIVE
Whether null field values should throw an exception if bound to a primitive
|
static String |
LAZY_IF_EMPTY
Whether objects are lazily instantiated if Strings are empty, rather than just null.
|
static String |
NULL_ESCAPING_ENABLED
Whether the null character can be escaped using \0 when property escaping is enabled.
|
static String |
PROPERTY_ACCESSOR_METHOD
The method of property access to use, 'reflection' (default) or 'asm' is supported
|
static String |
PROPERTY_ESCAPING_ENABLED
Whether property values support the following escape sequences:
\\ - Backslash
\n - Line Feed
\r - Carriage Return
\t - Tab
\f - Form Feed
\0 - Null
|
static String |
PROPERTY_SUBSTITUTION_ENABLED
Whether property substitution is enabled for mapping files
|
static String |
SORT_XML_COMPONENTS_BY_POSITION
Whether XML components should be sorted by position.
|
static String |
STREAM_FACTORY_CLASS
This property is set to the fully qualified class name of the default stream factory implementation
|
static String |
USE_DEFAULT_IF_MISSING
Whether default field values apply to missing fields
|
static String |
XML_WRITER_UPDATE_STATE_USING_DELTA
Used for Spring Batch integration.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(String key)
Returns the boolean value of a BeanIO configuration setting.
|
static Settings |
getInstance()
Returns the Settings instance.
|
static Settings |
getInstance(ClassLoader classLoader)
Returns the Settings instance.
|
int |
getInt(String key,
int defaultValue)
Returns a BeanIO configuration setting as an integer.
|
String |
getProperty(String key)
Returns a BeanIO configuration setting.
|
public static final String STREAM_FACTORY_CLASS
public static final String DEFAULT_LOCALE
public static final String DEFAULT_DATE_FORMAT
public static final String DEFAULT_DATETIME_FORMAT
public static final String DEFAULT_TIME_FORMAT
public static final String PROPERTY_ESCAPING_ENABLED
A backslash preceding any other character is ignored.
Set to false to disable.
public static final String NULL_ESCAPING_ENABLED
public static final String PROPERTY_SUBSTITUTION_ENABLED
public static final String DEFAULT_XML_TYPE
public static final String DEFAULT_XSI_NAMESPACE_PREFIX
public static final String XML_WRITER_UPDATE_STATE_USING_DELTA
public static final String DEFAULT_MARSHALLING_ENABLED
public static final String DEFAULT_GROUP_MIN_OCCURS
public static final String DEFAULT_RECORD_MIN_OCCURS
public static final String DEFAULT_FIELD_MIN_OCCURS
public static final String PROPERTY_ACCESSOR_METHOD
public static final String CREATE_MISSING_BEANS
public static final String LAZY_IF_EMPTY
public static final String ERROR_IF_NULL_PRIMITIVE
public static final String USE_DEFAULT_IF_MISSING
public static final String SORT_XML_COMPONENTS_BY_POSITION
public static final String ALLOW_PROTECTED_PROPERTY_ACCESS
public String getProperty(String key)
key
- the name of the settingpublic boolean getBoolean(String key)
key
- the property keypublic int getInt(String key, int defaultValue)
key
- the property keydefaultValue
- the default value if the setting wasn't
configured or invalidpublic static Settings getInstance()
public static Settings getInstance(ClassLoader classLoader)
classLoader
- the ClassLoader
to use for loading classpath resources