Icodeon SCORM 2004 Player Version 2 API Specification

com.icodeon.xml
Class Serializer

java.lang.Object
  extended by com.icodeon.xml.Serializer

public class Serializer
extends java.lang.Object


Field Summary
static java.lang.String DEFAULT_IMPL_CLASSNAME
           
static int INSTANCE_TYPE_CASTOR
           
static int INSTANCE_TYPE_XOM
           
static java.lang.String UTF_8
           
 
Constructor Summary
Serializer()
           
Serializer(java.lang.String parserClassName, boolean validate)
           
 
Method Summary
 java.lang.Object deserializeFromFile(java.lang.Class type, java.lang.String filePath, int instanceType)
           
 java.lang.Object deserializeFromString(java.lang.Class type, java.lang.String xml, int instanceType)
           
 void serializeToFile(java.lang.Object instance, java.lang.String filePath, int instanceType)
          The correct thing to do seems to be to use the following: OutputStreamWriter out = new OutputStreamWriter( new FileOutputStream(path),"UTF-8"); Which ensures that you are using UTF-8.
 java.lang.String serializeToString(java.lang.Object instance, int instanceType)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE_TYPE_CASTOR

public static final int INSTANCE_TYPE_CASTOR
See Also:
Constant Field Values

INSTANCE_TYPE_XOM

public static final int INSTANCE_TYPE_XOM
See Also:
Constant Field Values

DEFAULT_IMPL_CLASSNAME

public static final java.lang.String DEFAULT_IMPL_CLASSNAME
See Also:
Constant Field Values

UTF_8

public static final java.lang.String UTF_8
See Also:
Constant Field Values
Constructor Detail

Serializer

public Serializer()

Serializer

public Serializer(java.lang.String parserClassName,
                  boolean validate)
Method Detail

serializeToString

public final java.lang.String serializeToString(java.lang.Object instance,
                                                int instanceType)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

serializeToFile

public final void serializeToFile(java.lang.Object instance,
                                  java.lang.String filePath,
                                  int instanceType)
                           throws java.lang.Exception
The correct thing to do seems to be to use the following: OutputStreamWriter out = new OutputStreamWriter( new FileOutputStream(path),"UTF-8"); Which ensures that you are using UTF-8.

Parameters:
instance -
filePath -
instanceType -
Throws:
java.lang.Exception

deserializeFromString

public final java.lang.Object deserializeFromString(java.lang.Class type,
                                                    java.lang.String xml,
                                                    int instanceType)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

deserializeFromFile

public final java.lang.Object deserializeFromFile(java.lang.Class type,
                                                  java.lang.String filePath,
                                                  int instanceType)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

Icodeon SCORM 2004 Player Version 2 API Specification

Copyright (c) 2007 Icodeon Ltd - Registered Company in England and Wales No: 5068195