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

## org.eclipse.smila.datamodel.impl
Class DefaultDataFactoryImpl

    java.lang.Object
      org.eclipse.smila.datamodel.impl.DefaultDataFactoryImpl

All Implemented Interfaces:
  DataFactory

    public class DefaultDataFactoryImpl

extends java.lang.Object
implements DataFactory

Implementation of DataFactory.

Author:
  cind01

Field Summary
`static AnyMap` | `IMMUTABLE_EMPTY_MAP` immutable empyty map.
`static DefaultDataFactoryImpl` | `INSTANCE` instance for sharing.

Fields inherited from interface org.eclipse.smila.datamodel.DataFactory
`DEFAULT`

Constructor Summary
`DefaultDataFactoryImpl()`

Method Summary
`Value` | `autoConvertValue(java.lang.Object object)` auto converts the given object into the object's corresponding Value.
`Any` | `cloneAny(Any source)` Clone Any object.
`AnyMap` | `cloneAnyMap(AnyMap source)` Clone AnyMap object.
`AnySeq` | `cloneAnySeq(AnySeq source)` Clone AnySeq object.
`Record` | `cloneRecord(Record source, java.lang.String newId)` create clone of record with new Id.
`AnyMap` | `createAnyMap()`
`AnySeq` | `createAnySeq()`
`Value` | `createBooleanValue(java.lang.Boolean value)`
`Value` | `createDateTimeValue(java.util.Date value)`
`Value` | `createDateValue(java.util.Date value)`
`Value` | `createDoubleValue(java.lang.Double value)`
`Value` | `createDoubleValue(float value)`
`Value` | `createLongValue(int value)`
`Value` | `createLongValue(java.lang.Long value)`
`Record` | `createRecord()` create a new Record.
`Record` | `createRecord(java.lang.String id)` create a new Record.
`Record` | `createRecord(java.lang.String id, java.lang.String source)` create a new Record.
`Value` | `createStringValue(java.lang.String value)`
`Value` | `parseFromObject(java.lang.Object object)` Deprecated. Use `autoConvertValue(Object)` instead
`Value` | `parseFromString(java.lang.String value, Any.ValueType valueType)`
`Value` | `parseFromString(java.lang.String value, java.lang.String type)`
`Value` | `tryDateTimestampParsingFromString(java.lang.String value)` Tries to convert the String to a Date or Timestamp Value, if not possible return a String Value.

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

Field Detail

### INSTANCE

    public static final DefaultDataFactoryImpl INSTANCE

  instance for sharing.

### IMMUTABLE_EMPTY_MAP

    public static final AnyMap IMMUTABLE_EMPTY_MAP

  immutable empyty map.

Constructor Detail

### DefaultDataFactoryImpl

    public DefaultDataFactoryImpl()

Method Detail

### createRecord

    public Record createRecord()

  create a new Record.

  Specified by:
    `createRecord` in interface `DataFactory`
  Returns:
    new record.

### createRecord

    public Record createRecord(java.lang.String id)

  create a new Record.

  Specified by:
    `createRecord` in interface `DataFactory`
  Parameters:
    `id` - record id
  Returns:
    new record.

### createRecord

    public Record createRecord(java.lang.String id,
                               java.lang.String source)

  create a new Record.

  Specified by:
    `createRecord` in interface `DataFactory`
  Parameters:
    `id` - record id
    `source` - record data source
  Returns:
    new record.

### createAnyMap

    public AnyMap createAnyMap()

  Specified by:
    `createAnyMap` in interface `DataFactory`
  Returns:
    The created AnyMap object

### createAnySeq

    public AnySeq createAnySeq()

  Specified by:
    `createAnySeq` in interface `DataFactory`
  Returns:
    The created AnySeq object

### createStringValue

    public Value createStringValue(java.lang.String value)

  Specified by:
    `createStringValue` in interface `DataFactory`
  Parameters:
    `value` - the String to create the Value from.
  Returns:
    The created Value object.

### createBooleanValue

    public Value createBooleanValue(java.lang.Boolean value)

  Specified by:
    `createBooleanValue` in interface `DataFactory`
  Parameters:
    `value` - the Boolean to create the Value from.
  Returns:
    The created Value object.

### createLongValue

    public Value createLongValue(java.lang.Long value)

  Specified by:
    `createLongValue` in interface `DataFactory`
  Parameters:
    `value` - the Long to create the Value from.
  Returns:
    The created Value object.

### createLongValue

    public Value createLongValue(int value)

  Specified by:
    `createLongValue` in interface `DataFactory`
  Parameters:
    `value` - the int to create the Value from.
  Returns:
    The created Value object.

### createDoubleValue

    public Value createDoubleValue(java.lang.Double value)

  Specified by:
    `createDoubleValue` in interface `DataFactory`
  Parameters:
    `value` - the Double to create the Value from.
  Returns:
    The created Value object.

### createDoubleValue

    public Value createDoubleValue(float value)

  Specified by:
    `createDoubleValue` in interface `DataFactory`
  Parameters:
    `value` - the float to create the Value from.
  Returns:
    The created Value object.

### createDateValue

    public Value createDateValue(java.util.Date value)

  Specified by:
    `createDateValue` in interface `DataFactory`
  Parameters:
    `value` - the Date to create the Value from.
  Returns:
    The created Value object.

### createDateTimeValue

    public Value createDateTimeValue(java.util.Date value)

  Specified by:
    `createDateTimeValue` in interface `DataFactory`
  Parameters:
    `value` - the DateTime to create the Value from.
  Returns:
    The created Value object.

### parseFromString

    public Value parseFromString(java.lang.String value,
                                 java.lang.String type)

  Specified by:
    `parseFromString` in interface `DataFactory`
  Parameters:
    `value` - The value
    `type` - The type
  Returns:
    The Value object with correct type, InvalidvalueTypeException else.

### parseFromString

    public Value parseFromString(java.lang.String value,
                                 Any.ValueType valueType)

  Specified by:
    `parseFromString` in interface `DataFactory`
  Parameters:
    `value` - The value
    `valueType` - The value's type
  Returns:
    The Value object with correct type, InvalidvalueTypeException else.

### tryDateTimestampParsingFromString

    public Value tryDateTimestampParsingFromString(java.lang.String value)

  Tries to convert the String to a Date or Timestamp Value, if not possible return a String Value.

  Specified by:
    `tryDateTimestampParsingFromString` in interface `DataFactory`
  Parameters:
    `value` - The value to check for Date/Timestamp
  Returns:
    The Value object with guessed type, InvalidvalueTypeException if value is null.

### parseFromObject

    @Deprecated
    public Value parseFromObject(java.lang.Object object)

  Deprecated. Use `autoConvertValue(Object)` instead

  Specified by:
    `parseFromObject` in interface `DataFactory`
  Parameters:
    `object` - The object
  Returns:
    The value matching the class of given object, InvalidValueTypeException otherwise.

### autoConvertValue

    public Value autoConvertValue(java.lang.Object object)

  auto converts the given object into the object's corresponding Value.

  Specified by:
    `autoConvertValue` in interface `DataFactory`
  Parameters:
    `object` - The object, must be one of the simple types
  Returns:
    The value matching the class of given object, InvalidValueTypeException otherwise.

### cloneAny

    public Any cloneAny(Any source)

  Clone Any object.

  Specified by:
    `cloneAny` in interface `DataFactory`
  Parameters:
    `source` - the source
  Returns:
    the attribute

### cloneAnyMap

    public AnyMap cloneAnyMap(AnyMap source)

  Clone AnyMap object.

  Specified by:
    `cloneAnyMap` in interface `DataFactory`
  Parameters:
    `source` - the source
  Returns:
    the attribute

### cloneAnySeq

    public AnySeq cloneAnySeq(AnySeq source)

  Clone AnySeq object.

  Specified by:
    `cloneAnySeq` in interface `DataFactory`
  Parameters:
    `source` - the source
  Returns:
    the attribute

### cloneRecord

    public Record cloneRecord(Record source,
                              java.lang.String newId)

  create clone of record with new Id.

  Specified by:
    `cloneRecord` in interface `DataFactory`
  Parameters:
    `source` - a record
    `newId` - new Id
  Returns:
    clone of record.

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