public class PropertyFormatInfo extends Object
Used for storing formatting/parsing rules of CSV and other text files.
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_NAME |
static String |
LOCALE |
static String |
NULL_STRING |
static String |
PAD_CHAR |
static String |
PAD_LEFT |
static String |
PAD_RIGHT |
static String |
PATTERN |
static String |
TRIM |
static String |
TYPE |
| Constructor and Description |
|---|
PropertyFormatInfo(Map<String,PropertyFormat> formatMap) |
PropertyFormatInfo(Map<String,PropertyFormat> formatMap,
PropertyFormat defaultFormat)
Create an instance using a map of columns formats and a default format to use for undeclared columns.
|
| Modifier and Type | Method and Description |
|---|---|
static PropertyFormatInfo |
createEmpty()
Creates an empty format without columns.
|
PropertyFormat |
getDefaultFormat() |
PropertyFormat |
getPropertyFormat(String propertyName)
Returns format for a specified property.
|
boolean |
isEmpty() |
static PropertyFormatInfo |
parse(ConnectionParameters params,
String prefix) |
static PropertyFormatInfo |
parse(TypedPropertiesSource properties,
String prefix)
Creates a
PropertyFormatInfo from specified properties. |
protected static void |
setProperty(PropertyFormat f,
String columnPropName,
String key,
TypedPropertiesSource ps) |
String |
toString() |
public static final String NULL_STRING
public static final String TRIM
public static final String CLASS_NAME
public static final String PATTERN
public static final String LOCALE
public static final String TYPE
public static final String PAD_LEFT
public static final String PAD_RIGHT
public static final String PAD_CHAR
public PropertyFormatInfo(Map<String,PropertyFormat> formatMap)
public PropertyFormatInfo(Map<String,PropertyFormat> formatMap, PropertyFormat defaultFormat)
formatMap - defaultFormat - default format for undeclared columns. It does not have impact on formatting rules
defined in formatMap.public PropertyFormat getPropertyFormat(String propertyName)
propertyName - property name.public boolean isEmpty()
public PropertyFormat getDefaultFormat()
public static PropertyFormatInfo parse(ConnectionParameters params, String prefix)
public static PropertyFormatInfo parse(TypedPropertiesSource properties, String prefix)
PropertyFormatInfo from specified properties.
The properties file has the following structure:
[prefix]propertyName.key=value
properties - properties defining formatting.prefix - prefix for recognizing formatting properties. Nulls not allowedPropertyFormatInfo with a specified column formatting.protected static void setProperty(PropertyFormat f, String columnPropName, String key, TypedPropertiesSource ps)
public static PropertyFormatInfo createEmpty()
Copyright © 2006-2012. All Rights Reserved.