- java.lang.Object
-
- org.tentackle.model.parse.Line
-
- org.tentackle.model.parse.SingleLine
-
- org.tentackle.model.parse.AttributeLine
-
public class AttributeLine extends SingleLine
The attribute definition line.An attribute line is defined as follows:
javaType[(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
- size: the number of columns or width or digits w/o scale if numeric
- scale: the scale (numeric 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
- javaType - is the java class name or primitive. Allowed types are:
-
-
Constructor Summary
Constructors Constructor Description AttributeLine(Document document, int offset, LineType lineType)Creates an attribute line.
This line always spans only one line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetColumnName()Gets the column name in database table.java.lang.StringgetComment()Gets the comment.java.lang.StringgetInnerName()Gets the generic type.java.lang.StringgetJavaName()Gets the Java attribute name.java.lang.StringgetJavaType()Gets the java type.java.util.List<java.lang.String>getOptions()Gets the options.java.lang.IntegergetScale()Gets the numeric scale.java.lang.IntegergetSize()Gets the size.voidparse()Parses a line.-
Methods inherited from class org.tentackle.model.parse.Line
assertParsed, createModelException, createModelException, getDocument, getLength, getLineNumber, getLineType, getOffset, getSourceInfo, getText, setLength, toString
-
-
-
-
Method Detail
-
parse
public void parse() throws ModelExceptionDescription copied from class:LineParses a line.- Overrides:
parsein classSingleLine- Throws:
ModelException- if parsing failed
-
getJavaType
public java.lang.String getJavaType() throws ModelExceptionGets the java type.- Returns:
- the javaType, never null
- Throws:
ModelException- if not parsed
-
getInnerName
public java.lang.String getInnerName() throws ModelExceptionGets the generic type.- Returns:
- the genericType, never null
- Throws:
ModelException- if not parsed
-
getSize
public java.lang.Integer getSize() throws ModelExceptionGets the size.- Returns:
- the size, null if not set
- Throws:
ModelException- if not parsed
-
getScale
public java.lang.Integer getScale() throws ModelExceptionGets the numeric scale.- Returns:
- the scale, null if not set
- Throws:
ModelException- if not parsed
-
getJavaName
public java.lang.String getJavaName() throws ModelExceptionGets the Java attribute name.- Returns:
- the java name
- Throws:
ModelException- if not parsed
-
getColumnName
public java.lang.String getColumnName() throws ModelExceptionGets the column name in database table.- Returns:
- the column name
- Throws:
ModelException- if not parsed
-
getComment
public java.lang.String getComment() throws ModelExceptionGets the comment.- Returns:
- the comment, never null
- Throws:
ModelException- if not parsed
-
getOptions
public java.util.List<java.lang.String> getOptions() throws ModelExceptionGets the options.- Returns:
- the options (never null)
- Throws:
ModelException- if not parsed
-
-