org.qtitools.qti.value
Class FileValue

java.lang.Object
  extended by org.qtitools.qti.value.SingleValue
      extended by org.qtitools.qti.value.FileValue
All Implemented Interfaces:
java.io.Serializable, Value

public class FileValue
extends SingleValue

Implementation of BaseType file value.

Files are represented using MIME message streams, including the specification of headers for providing information about content type and encoding. For more information see [RFC2045].

There are not implemented any checks right now. Valid file value is any non empty string!

Example value:

 Content-Type: image/gif; name="works.gif" ; x-mac-type="47494666"
 ; x-mac-creator="4A565752"
 Content-Disposition: attachment; filename="works.gif"
 Content-Transfer-Encoding: base64

 R0lGODlhGgAXAPcAAP//////zP//mf//Zv//M///AP/M///MzP/Mmf/MZv/MM//MAP+Z
 //+ZzP+Zmf+ZZv+ZM/+ZAP9m//9mzP9mmf9mZv9mM/9mAP8z//8zzP8zmf8zZv8zM/8z
 AP8A//8AzP8Amf8AZv8AM/8AAMz//8z/zMz/mcz/Zsz/M8z/AMzM/8zMzMzMmczMZszM
 M8zMAMyZ/8yZzMyZmcyZZsyZM8yZAMxm/8xmzMxmmcxmZsxmM8xmAMwz/8wzzMwzmcwz
 ZswzM8wzAMwA/8wAzMwAmcwAZswAM8wAAJn//5n/zJn/mZn/Zpn/M5n/AJnM/5nMzJnM
 mZnMZpnMM5nMAJmZ/5mZzJmZmZmZZpmZM5mZAJlm/5lmzJlmmZlmZplmM5lmAJkz/5kz
 zJkzmZkzZpkzM5kzAJkA/5kAzJkAmZkAZpkAM5kAAGb//2b/zGb/mWb/Zmb/M2b/AGbM
 /2bMzGbMmWbMZmbMM2bMAGaZ/2aZzGaZmWaZZmaZM2aZAGZm/2ZmzGZmmWZmZmZmM2Zm
 AGYz/2YzzGYzmWYzZmYzM2YzAGYA/2YAzGYAmWYAZmYAM2YAADP//zP/zDP/mTP/ZjP/
 MzP/ADPM/zPMzDPMmTPMZjPMMzPMADOZ/zOZzDOZmTOZZjOZMzOZADNm/zNmzDNmmTNm
 ZjNmMzNmADMz/zMzzDMzmTMzZjMzMzMzADMA/zMAzDMAmTMAZjMAMzMAAAD//wD/zAD/
 mQD/ZgD/MwD/AADM/wDMzADMmQDMZgDMMwDMAACZ/wCZzACZmQCZZgCZMwCZAABm/wBm
 zABmmQBmZgBmMwBmAAAz/wAzzAAzmQAzZgAzMwAzAAAA/wAAzAAAmQAAZgAAM+4AAN0A
 ALsAAKoAAIgAAHcAAFUAAEQAACIAABEAAADuAADdAAC7AACqAACIAAB3AABVAABEAAAi
 AAARAAAA7gAA3QAAuwAAqgAAiAAAdwAAVQAARAAAIgAAEe7u7t3d3bu7u6qqqoiIiHd3
 d1VVVURERCIiIhEREQAAACH5BAEAAAEALAAAAAAaABcABwigAAMIHEgwwL+D/woqXEjw
 HzZsCRlKHOjwIcSJEys+jIhRYUUAADZ29PgQpMiRFEuCDHkR5ceVJlt2/OivZkyOGVXW
 9LfyZE5sIHf2lMnw5UqbN3/CBCCUJc6CRoPu5Om06EOqTKdS9dnwqlapWLka9Dr1aNOq
 KbFppWoTKdqxatdKnZsU7tq2bMNe1Gixr9+/Fg8CHkwYoeHDiBMfBAggIAA7
 

This class is not mutable and cannot contain NULL value.

Cardinality of this class is always single and BaseType is always file.

Author:
Jiri Kajaba
See Also:
Cardinality, BaseType, Serialized Form

Constructor Summary
FileValue(java.lang.String value)
          Constructs FileValue from given String representation.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 BaseType getBaseType()
          Returns baseType of this value.
 int hashCode()
           
 java.lang.String stringValue()
          Returns the value of this FileValue as A String.
 java.lang.String toString()
           
 
Methods inherited from class org.qtitools.qti.value.SingleValue
getCardinality, isNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileValue

public FileValue(java.lang.String value)
          throws QTIParseException
Constructs FileValue from given String representation.

Parameters:
value - String representation of FileValue
Throws:
QTIParseException - if String representation of FileValue is not valid
Method Detail

getBaseType

public BaseType getBaseType()
Description copied from interface: Value
Returns baseType of this value.

If value is NULL or record cardinality returns null.

Returns:
baseType of this value

stringValue

public java.lang.String stringValue()
Returns the value of this FileValue as A String.

Returns:
the value of this FileValue as A String

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.