java.lang.Object
org.tentackle.model.parse.Line
org.tentackle.model.parse.SingleLine
org.tentackle.model.parse.AttributeLine
The attribute definition line.
An attribute line is defined as follows:
javaType[<innerType>][(size[,scale])] javaName columnName [comment] [\[options\]]Where:
- javaType - is the java class name or primitive. Allowed types are:
- primitives: boolean, byte, char, short, int, long, float, double
- classes: Boolean, Byte, Character, Short, Integer, Long, Float, Double, BigDecimal, BMoney, DMoney, Binary, Date, Time, Timestamp, String
- innerType: optional inner/generic type
- size: optional number of columns or width or non-fractional digits if numeric
- scale: optional scale (numeric types only)
- javaName: the name used in Java sources (must start lowercase)
- columnName: the database column name
- comment: the optional comment
- [options]: the options enclosed in double quotes. Options beginning with an '@' are treated as annotations
Examples:
long subsidiaryId subsidiary_id subsidiary ID [contextid] String(10) invoiceNo invoice_no the unique invoice number [uc] Date invoiceDate invoice_date the invoice's date long customerId customer_id object ID of the customer [uc] String(200) address address the address (multiline) [default 'blah'] DMoney total total sum (without tax) DMoney tax tax tax (vat) Timestamp printed printed first printed Double(10,2) someDouble some_double digits with scale MyType<int> extra extra some application specific type
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeLine(Document document, int offset, LineType lineType) Creates an attribute line.
This line always spans only one line. -
Method Summary
Methods inherited from class org.tentackle.model.parse.Line
assertParsed, createModelException, createModelException, getDocument, getLength, getLineNumber, getLineType, getOffset, getSourceInfo, getText, setLength, toString
-
Constructor Details
-
AttributeLine
Creates an attribute line.
This line always spans only one line.- Parameters:
document- the whole documentoffset- offset to first character within documentlineType- the line type
-
-
Method Details
-
parse
Description copied from class:LineParses a line.- Overrides:
parsein classSingleLine- Throws:
ModelException- if parsing failed
-
getJavaType
Gets the java type name.- Returns:
- the java name, never null
- Throws:
ModelException- if not parsed
-
getInnerType
Gets the inner type name.- Returns:
- the inner type, null if regular type
- Throws:
ModelException- if not parsed
-
getSize
Gets the size.- Returns:
- the size, null if not set
- Throws:
ModelException- if not parsed
-
getScale
Gets the numeric scale.- Returns:
- the scale, null if not set
- Throws:
ModelException- if not parsed
-
getJavaName
Gets the Java attribute name.- Returns:
- the java name
- Throws:
ModelException- if not parsed
-
getColumnName
Gets the column name in database table.- Returns:
- the column name
- Throws:
ModelException- if not parsed
-
getComment
Gets the comment.- Returns:
- the comment, never null
- Throws:
ModelException- if not parsed
-
getOptions
Gets the options.- Returns:
- the options (never null)
- Throws:
ModelException- if not parsed
-