Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.servingxml.util.record
Class RecordBuilder

    java.lang.Object
      com.servingxml.util.record.AbstractRecord
          com.servingxml.util.record.RecordBuilder

All Implemented Interfaces:
  Record

Direct Known Subclasses:
  ParameterBuilder

    public class RecordBuilder

extends AbstractRecord
implements Record

A `RecordBuilder` class builds instances of `Record`.

Field Summary

Fields inherited from interface com.servingxml.util.record.Record
`EMPTY, EMPTY_ARRAY, EMPTY_RECORD_TYPE_NAME`

Constructor Summary
`RecordBuilder(Name recordTypeName)` Creates a record builder with no initial field types.
`RecordBuilder(Name recordTypeName, int capacity)` Creates a record builder with no initial field types.
`RecordBuilder(Name recordTypeName, Record record)` Creates a record builder with the same fields as an exisiting record, but a different record type.
`RecordBuilder(Record record)` Creates a record builder with the same record type and fields as an existing record.
`RecordBuilder(RecordType recordType)` Creates a record builder with no initial field types.

Method Summary
`protected int` | `addFieldType(FieldType fieldType)` Adds a field type.
`void` | `clear()`
`int` | `fieldCount()` Gets the number of fields
`protected int` | `getFieldIndex(Name name)`
`Name` | `getFieldName(int i)`
`java.lang.Object` | `getObject(Name name)` Gets the value of a field as a Java object.
`RecordType` | `getRecordType()`
`java.lang.String` | `getString(Name name)` Gets the value of a field as a string.
`java.lang.String[]` | `getStringArray(Name name)` Gets the value of a field as a string array.
`Value` | `getValue(int index)` Gets the value of a field at the specified index.
`Value` | `getValue(Name name)` Gets the value of a field with the specified name.
`void` | `setBigDecimal(Name name, java.math.BigDecimal value)` Sets a BigDecimal value for a field.
`void` | `setBoolean(Name name, boolean value)` Sets a boolean value for a field.
`void` | `setBoolean(Name name, java.lang.Boolean value)` Sets a Boolean value for a field.
`void` | `setByte(Name name, byte value)` Sets a byte value for a field.
`void` | `setByte(Name name, java.lang.Byte value)` Sets a Byte value for a field.
`void` | `setDate(Name name, java.sql.Date value)` Sets a SQL date value for a field.
`void` | `setDate(Name name, long value)` Sets a SQL date value for a field.
`void` | `setDateTime(Name name, long value)` Sets a SQL timestamp value for a field.
`void` | `setDateTime(Name name, java.sql.Timestamp value)` Sets a SQL timestamp value for a field.
`void` | `setDouble(Name name, double value)` Sets a double value for a field.
`void` | `setDouble(Name name, java.lang.Double value)` Sets a Double value for a field.
`void` | `setField(Name name, Record segment)` Deprecated. since ServingXML 0.8.1: replaced by `setSegments(com.servingxml.util.Name, com.servingxml.util.record.Record[])`
`void` | `setField(Name name, Record[] segments)` Deprecated. since ServingXML 0.8.1: replaced by `setSegments(com.servingxml.util.Name, com.servingxml.util.record.Record[])`
`void` | `setField(Name name, java.lang.String s)` Deprecated. since ServingXML 0.6.1: use `setString(com.servingxml.util.Name, java.lang.String)`
`void` | `setField(Name name, java.lang.String[] sa)` Deprecated. since ServingXML 0.6.1: use `setStringArray(com.servingxml.util.Name, java.lang.String[])`
`void` | `setField(Name name, Value value)` Deprecated. since ServingXML 0.6.4: use `setValue(int, com.servingxml.util.record.Value)`
`void` | `setFloat(Name name, float value)` Sets a float value for a field.
`void` | `setFloat(Name name, java.lang.Float value)` Sets a Float value for a field.
`void` | `setHexBinary(Name name, byte[] value)` Sets a byte[] value for a field.
`void` | `setInteger(Name name, int value)` Sets a int value for a field.
`void` | `setInteger(Name name, java.lang.Integer value)` Sets a Integer value for a field.
`void` | `setLong(Name name, long value)` Sets a long value for a field.
`void` | `setLong(Name name, java.lang.Long value)` Sets a Long value for a field.
`void` | `setObject(Name name, java.lang.Object o)` Sets a Object value for a field.
`void` | `setPackedDecimal(Name name, PackedDecimal value)` Sets a packed decimal value for a field.
`void` | `setRecords(Name name, Record[] records)` Sets a record array value for a field.
`void` | `setSegments(Name name, Record[] records)` Deprecated. since ServingXML 0.8.3: replaced by `setRecords(com.servingxml.util.Name, com.servingxml.util.record.Record[])`
`void` | `setShort(Name name, short value)` Sets a short value for a field.
`void` | `setShort(Name name, java.lang.Short value)` Sets a Short value for a field.
`void` | `setString(Name name, java.lang.String s)` Sets a string value for a field.
`void` | `setStringArray(Name name, java.lang.String[] sa)` Sets a string array value for a field.
`void` | `setTime(Name name, long value)` Sets a SQL time value for a field.
`void` | `setTime(Name name, java.sql.Time value)` Sets a SQL time value for a field.
`void` | `setValue(FieldType fieldType, Value value)` Sets a value for a field.
`void` | `setValue(int index, Value value)` Sets a value for a field at an index.
`void` | `setValue(Name name, Value value)` Sets a value for a field.
`Record` | `toRecord()`
`void` | `writeToContentHandler(PrefixMap prefixMap, org.xml.sax.ContentHandler handler)`

Methods inherited from class com.servingxml.util.record.AbstractRecord
`createXmlReader, toString, toXmlString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.servingxml.util.record.Record
`createXmlReader, toXmlString`

Constructor Detail

### RecordBuilder

    public RecordBuilder(RecordType recordType)

  Creates a record builder with no initial field types.

### RecordBuilder

    public RecordBuilder(Name recordTypeName)

  Creates a record builder with no initial field types.

### RecordBuilder

    public RecordBuilder(Name recordTypeName,
                         int capacity)

  Creates a record builder with no initial field types.

### RecordBuilder

    public RecordBuilder(Record record)

  Creates a record builder with the same record type and fields as an existing record.

### RecordBuilder

    public RecordBuilder(Name recordTypeName,
                         Record record)

  Creates a record builder with the same fields as an exisiting record, but a different record type.

Method Detail

### setValue

    public void setValue(int index,
                         Value value)

  Sets a value for a field at an index.

  Parameters:
    `index` - The index
    `value` - The value.

### setField

    @Deprecated
    public void setField(Name name,
                                    Value value)

  Deprecated. since ServingXML 0.6.4: use `setValue(int, com.servingxml.util.record.Value)`

  Sets a value for a field.

  Parameters:
    `name` - The field name.
    `value` - The field value.

### setField

    @Deprecated
    public void setField(Name name,
                                    java.lang.String s)

  Deprecated. since ServingXML 0.6.1: use `setString(com.servingxml.util.Name, java.lang.String)`

  Sets a string value for a field.

  Parameters:
    `name` - The field name.
    `s` - The string value.

### setField

    @Deprecated
    public void setField(Name name,
                                    java.lang.String[] sa)

  Deprecated. since ServingXML 0.6.1: use `setStringArray(com.servingxml.util.Name, java.lang.String[])`

  Sets a string array value for a field.

  Parameters:
    `name` - The field name.
    `sa` - The string array value.

### setObject

    public void setObject(Name name,
                          java.lang.Object o)

  Sets a Object value for a field.

  Parameters:
    `name` - The field name.
    `o` - The object value.

### setString

    public void setString(Name name,
                          java.lang.String s)

  Sets a string value for a field.

  Parameters:
    `name` - The field name.
    `s` - The string value.

### setStringArray

    public void setStringArray(Name name,
                               java.lang.String[] sa)

  Sets a string array value for a field.

  Parameters:
    `name` - The field name.
    `sa` - The string array value.

### setDateTime

    public void setDateTime(Name name,
                            java.sql.Timestamp value)

  Sets a SQL timestamp value for a field.

  Parameters:
    `name` - The field name.
    `value` - The timestamp value.

### setDateTime

    public void setDateTime(Name name,
                            long value)

  Sets a SQL timestamp value for a field.

  Parameters:
    `name` - The field name.
    `value` - milliseconds since January 1, 1970, 00:00:00 GMT. A negative number is the number of millisecondsbefore January 1, 1970, 00:00:00 GMT.

### setDate

    public void setDate(Name name,
                        java.sql.Date value)

  Sets a SQL date value for a field.

  Parameters:
    `name` - The field name.
    `value` - The date value.

### setDate

    public void setDate(Name name,
                        long value)

  Sets a SQL date value for a field.

  Parameters:
    `name` - The field name.
    `value` - milliseconds since January 1, 1970, 00:00:00 GMT. A negative number is the number of millisecondsbefore January 1, 1970, 00:00:00 GMT.

### setTime

    public void setTime(Name name,
                        java.sql.Time value)

  Sets a SQL time value for a field.

  Parameters:
    `name` - The field name.
    `value` - The time value.

### setTime

    public void setTime(Name name,
                        long value)

  Sets a SQL time value for a field.

  Parameters:
    `name` - The field name.
    `value` - The time value.

### setHexBinary

    public void setHexBinary(Name name,
                             byte[] value)

  Sets a byte[] value for a field.

  Parameters:
    `name` - The field name.
    `value` - The byte[] value.

### setPackedDecimal

    public void setPackedDecimal(Name name,
                                 PackedDecimal value)

  Sets a packed decimal value for a field.

  Parameters:
    `name` - the field name.
    `value` - the packed decimal value.

### setByte

    public void setByte(Name name,
                        byte value)

  Sets a byte value for a field.

  Parameters:
    `name` - The field name.
    `value` - The byte value.

### setByte

    public void setByte(Name name,
                        java.lang.Byte value)

  Sets a Byte value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Byte value.

### setShort

    public void setShort(Name name,
                         short value)

  Sets a short value for a field.

  Parameters:
    `name` - The field name.
    `value` - The short value.

### setShort

    public void setShort(Name name,
                         java.lang.Short value)

  Sets a Short value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Short value.

### setInteger

    public void setInteger(Name name,
                           int value)

  Sets a int value for a field.

  Parameters:
    `name` - The field name.
    `value` - The int value.

### setInteger

    public void setInteger(Name name,
                           java.lang.Integer value)

  Sets a Integer value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Integer value.

### setLong

    public void setLong(Name name,
                        long value)

  Sets a long value for a field.

  Parameters:
    `name` - The field name.
    `value` - The long value.

### setLong

    public void setLong(Name name,
                        java.lang.Long value)

  Sets a Long value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Long value.

### setBoolean

    public void setBoolean(Name name,
                           boolean value)

  Sets a boolean value for a field.

  Parameters:
    `name` - The field name.
    `value` - The boolean value.

### setBoolean

    public void setBoolean(Name name,
                           java.lang.Boolean value)

  Sets a Boolean value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Boolean value.

### setFloat

    public void setFloat(Name name,
                         float value)

  Sets a float value for a field.

  Parameters:
    `name` - The field name.
    `value` - The float value.

### setFloat

    public void setFloat(Name name,
                         java.lang.Float value)

  Sets a Float value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Float value.

### setDouble

    public void setDouble(Name name,
                          double value)

  Sets a double value for a field.

  Parameters:
    `name` - The field name.
    `value` - The double value.

### setDouble

    public void setDouble(Name name,
                          java.lang.Double value)

  Sets a Double value for a field.

  Parameters:
    `name` - The field name.
    `value` - The Double value.

### setBigDecimal

    public void setBigDecimal(Name name,
                              java.math.BigDecimal value)

  Sets a BigDecimal value for a field.

  Parameters:
    `name` - The field name.
    `value` - The BigDecimal value.

### setValue

    public void setValue(Name name,
                         Value value)

  Sets a value for a field.

  Parameters:
    `name` - The field name.
    `value` - The field value.

### setValue

    public void setValue(FieldType fieldType,
                         Value value)

  Sets a value for a field.

  Parameters:
    `fieldType` - The field type.
    `value` - The field value.

### setField

    @Deprecated
    public void setField(Name name,
                                    Record segment)

  Deprecated. since ServingXML 0.8.1: replaced by `setSegments(com.servingxml.util.Name, com.servingxml.util.record.Record[])`

  Sets a segment value for a field.

  Parameters:
    `name` - The field name.
    `segment` - The segment value.

### setField

    @Deprecated
    public void setField(Name name,
                                    Record[] segments)

  Deprecated. since ServingXML 0.8.1: replaced by `setSegments(com.servingxml.util.Name, com.servingxml.util.record.Record[])`

  Sets a segment array value for a field.

  Parameters:
    `name` - The field name.
    `segments` - The segment array value.

### setSegments

    @Deprecated
    public void setSegments(Name name,
                                       Record[] records)

  Deprecated. since ServingXML 0.8.3: replaced by `setRecords(com.servingxml.util.Name, com.servingxml.util.record.Record[])`

  Sets a record array value for a field.

  Parameters:
    `name` - The field name.
    `records` - The record array value.

### setRecords

    public void setRecords(Name name,
                           Record[] records)

  Sets a record array value for a field.

  Parameters:
    `name` - The field name.
    `records` - The record array value.

### toRecord

    public Record toRecord()

### fieldCount

    public int fieldCount()

  Gets the number of fields

  Specified by:
    `fieldCount` in interface `Record`
  Returns:
    The number of fields

### getRecordType

    public RecordType getRecordType()

  Specified by:
    `getRecordType` in interface `Record`

### getValue

    public Value getValue(Name name)

  Description copied from interface: `Record`
  Gets the value of a field with the specified name.

  Specified by:
    `getValue` in interface `Record`
  Parameters:
    `name` - The field name.
  Returns:
    The field value

### getValue

    public Value getValue(int index)

  Description copied from interface: `Record`
  Gets the value of a field at the specified index.

  Specified by:
    `getValue` in interface `Record`
  Parameters:
    `index` - the index of the field.
  Returns:
    The field value

### getFieldName

    public Name getFieldName(int i)

  Specified by:
    `getFieldName` in interface `Record`

### getFieldIndex

    protected int getFieldIndex(Name name)

### addFieldType

    protected int addFieldType(FieldType fieldType)

  Adds a field type.

  Parameters:
    `fieldType` - A field type.

### clear

    public void clear()

### writeToContentHandler

    public void writeToContentHandler(PrefixMap prefixMap,
                                      org.xml.sax.ContentHandler handler)
                               throws org.xml.sax.SAXException

  Specified by:
    `writeToContentHandler` in interface `Record`
  Throws:
    `org.xml.sax.SAXException`

### getStringArray

    public java.lang.String[] getStringArray(Name name)

  Description copied from interface: `Record`
  Gets the value of a field as a string array.

  Specified by:
    `getStringArray` in interface `Record`
  Parameters:
    `name` - The field name.
  Returns:
    The field value as a string array.

### getString

    public java.lang.String getString(Name name)

  Description copied from interface: `Record`
  Gets the value of a field as a string.

  Specified by:
    `getString` in interface `Record`
  Parameters:
    `name` - The field name.
  Returns:
    The field value as a string.

### getObject

    public java.lang.Object getObject(Name name)

  Description copied from interface: `Record`
  Gets the value of a field as a Java object.

  Specified by:
    `getObject` in interface `Record`
  Parameters:
    `name` - The field name.
  Returns:
    The field value

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD