nl.knaw.dans.common.dbflib
Class StringValue

java.lang.Object
  extended by nl.knaw.dans.common.dbflib.Value
      extended by nl.knaw.dans.common.dbflib.StringValue

public class StringValue
extends Value

Represents a string value in a record (a CHARACTER or MEMO type field value).

Author:
Jan van Mansum

Field Summary
 
Fields inherited from class nl.knaw.dans.common.dbflib.Value
typed
 
Constructor Summary
StringValue(String stringValue)
          Creates a new string value that uses the platform's default character set.
StringValue(String stringValue, String charsetName)
          Creates a new StringValue object.
 
Method Summary
protected  byte[] doGetRawValue(Field field)
          Converts the typed value to a byte array, according to the field specifications provided.
protected  Object doGetTypedValue(byte[] rawValue)
          Converts the raw bytes to a Java object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValue

public StringValue(String stringValue,
                   String charsetName)
Creates a new StringValue object.

Parameters:
stringValue - aString
charsetName - the character set to use when encoding and decoding this string value

StringValue

public StringValue(String stringValue)
Creates a new string value that uses the platform's default character set.

Parameters:
stringValue -
Method Detail

doGetTypedValue

protected Object doGetTypedValue(byte[] rawValue)
Description copied from class: Value
Converts the raw bytes to a Java object. The class of Java object to create is determined by the subclass of Value.

Specified by:
doGetTypedValue in class Value
Returns:
the value as a Java object

doGetRawValue

protected byte[] doGetRawValue(Field field)
                        throws ValueTooLargeException
Description copied from class: Value
Converts the typed value to a byte array, according to the field specifications provided.

Specified by:
doGetRawValue in class Value
Parameters:
field - the field specifications
Returns:
a byte array containing the raw value
Throws:
ValueTooLargeException - if the value is too large for the field


Copyright © 2009-2012 DANS. All Rights Reserved.