public class PropertyFormatInfo
extends java.lang.Object
Used for storing formatting/parsing rules of CSV and other text files.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME |
static java.lang.String |
LOCALE |
static java.lang.String |
NULL_STRING |
static java.lang.String |
PAD_CHAR |
static java.lang.String |
PAD_LEFT |
static java.lang.String |
PAD_RIGHT |
static java.lang.String |
PATTERN |
static java.lang.String |
TRIM |
static java.lang.String |
TYPE |
Constructor and Description |
---|
PropertyFormatInfo(java.util.Map<java.lang.String,PropertyFormat> formatMap) |
PropertyFormatInfo(java.util.Map<java.lang.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(java.lang.String propertyName)
Returns format for a specified property.
|
boolean |
isEmpty() |
static PropertyFormatInfo |
parse(ConnectionParameters params,
java.lang.String prefix) |
static PropertyFormatInfo |
parse(TypedPropertiesSource properties,
java.lang.String prefix)
Creates a
PropertyFormatInfo from specified properties. |
protected static void |
setProperty(PropertyFormat f,
java.lang.String columnPropName,
java.lang.String key,
TypedPropertiesSource ps) |
java.lang.String |
toString() |
public static final java.lang.String NULL_STRING
public static final java.lang.String TRIM
public static final java.lang.String CLASS_NAME
public static final java.lang.String PATTERN
public static final java.lang.String LOCALE
public static final java.lang.String TYPE
public static final java.lang.String PAD_LEFT
public static final java.lang.String PAD_RIGHT
public static final java.lang.String PAD_CHAR
public PropertyFormatInfo(java.util.Map<java.lang.String,PropertyFormat> formatMap)
public PropertyFormatInfo(java.util.Map<java.lang.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(java.lang.String propertyName)
propertyName
- property name.public boolean isEmpty()
public PropertyFormat getDefaultFormat()
public static PropertyFormatInfo parse(ConnectionParameters params, java.lang.String prefix)
public static PropertyFormatInfo parse(TypedPropertiesSource properties, java.lang.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, java.lang.String columnPropName, java.lang.String key, TypedPropertiesSource ps)
public static PropertyFormatInfo createEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © Copyright 2006-2019 The Scriptella Project Team.