Class 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
    • Constructor Detail

      • AttributeLine

        public AttributeLine​(Document document,
                             int offset,
                             LineType lineType)
        Creates an attribute line.
        This line always spans only one line.
        Parameters:
        document - the whole document
        offset - offset to first character within document
        lineType - the line type
    • Method Detail

      • getJavaType

        public java.lang.String getJavaType()
                                     throws ModelException
        Gets the java type.
        Returns:
        the javaType, never null
        Throws:
        ModelException - if not parsed
      • getInnerName

        public java.lang.String getInnerName()
                                      throws ModelException
        Gets the generic type.
        Returns:
        the genericType, never null
        Throws:
        ModelException - if not parsed
      • getSize

        public java.lang.Integer getSize()
                                  throws ModelException
        Gets the size.
        Returns:
        the size, null if not set
        Throws:
        ModelException - if not parsed
      • getScale

        public java.lang.Integer getScale()
                                   throws ModelException
        Gets the numeric scale.
        Returns:
        the scale, null if not set
        Throws:
        ModelException - if not parsed
      • getJavaName

        public java.lang.String getJavaName()
                                     throws ModelException
        Gets the Java attribute name.
        Returns:
        the java name
        Throws:
        ModelException - if not parsed
      • getColumnName

        public java.lang.String getColumnName()
                                       throws ModelException
        Gets the column name in database table.
        Returns:
        the column name
        Throws:
        ModelException - if not parsed
      • getComment

        public java.lang.String getComment()
                                    throws ModelException
        Gets the comment.
        Returns:
        the comment, never null
        Throws:
        ModelException - if not parsed
      • getOptions

        public java.util.List<java.lang.String> getOptions()
                                                    throws ModelException
        Gets the options.
        Returns:
        the options (never null)
        Throws:
        ModelException - if not parsed