|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.equanda.ymport.ImportParser
public final class ImportParser
functions for parsing import data (commands and data)
Field Summary | |
---|---|
static ImportParser |
NULL
marker to indicate the literal parsed "null", has to be a distinguishable object |
Method Summary | |
---|---|
static String |
extractSelector(String tableSelector)
Extract the selector name (including slash) from a possible combined table/selector name |
static String |
extractTable(String tableSelector)
Extract the table name from a possible combined table/selector name |
static boolean |
isMultipleTableFields(String line)
Indicates that a creator/selector field definition can define multiple records. |
static Collection |
parse(String line)
Parse a data line. |
static byte[] |
parseBlob(Object value)
|
static boolean |
parseBoolean(Object value)
Parse a boolean. |
static String |
parseClob(Object value)
|
static Date |
parseDate(Object value)
Parse a date. |
static double |
parseDouble(Object value)
Parse a double. |
static int |
parseInt(Object value)
Parse an int. |
static String |
parseSelectorTable(String line)
Get the table name from selector/creater definition. |
static String |
parseString(Object value)
Parse a string. |
static Collection<String> |
parseTableFields(String line)
Get a collection of fieldnames from the table definition. |
static String |
parseTableTable(String line)
Get the table name with optional selector from the given table definition. |
static Timestamp |
parseTimestamp(Object value)
Parses a timestamp. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ImportParser NULL
Method Detail |
---|
public static Collection parse(String line) throws ImportHandlerException
line
- line to be parsed
ImportHandlerException
- if the line format is wrong (bracket or quote mismatch etc)public static String parseTableTable(String line) throws ImportHandlerException
line
- table definition string
ImportHandlerException
- when no field definition is includedpublic static String parseSelectorTable(String line)
line
- table definition string
public static boolean isMultipleTableFields(String line)
line
- data to check
public static Collection<String> parseTableFields(String line) throws ImportHandlerException
line
- table definition string
ImportHandlerException
- oopspublic static String extractTable(String tableSelector)
tableSelector
- combined table and selector name
public static String extractSelector(String tableSelector)
tableSelector
- combined table and selector name
public static String parseString(Object value) throws ImportHandlerException
value
- parsed proxy expected to be a String or NULL
ImportHandlerException
- invalid formatpublic static boolean parseBoolean(Object value) throws ImportHandlerException
value
- parsed proxy expected to be a one of ("1", "0", "true", "false", "yes", no")
ImportHandlerException
- invalid formatpublic static Date parseDate(Object value) throws ImportHandlerException
value
- parsed proxy expected in the format yyyy-MM-dd, or NULL
ImportHandlerException
- invalid formatpublic static Timestamp parseTimestamp(Object value) throws ImportHandlerException
value
- parsed proxy expected in the format yyyy-MM-dd HH:mm:ss, or NULL
ImportHandlerException
- invalid formatpublic static byte[] parseBlob(Object value)
public static String parseClob(Object value) throws ImportHandlerException
ImportHandlerException
public static int parseInt(Object value) throws ImportHandlerException
value
- parsed proxy, an integer as a string ("1", "22" etc)
ImportHandlerException
- invalid formatpublic static double parseDouble(Object value) throws ImportHandlerException
value
- parsed proxy, a double as a string ("1.1", "2" etc)
ImportHandlerException
- invalid format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |