Skip navigation links

Oracle® Fusion Middleware Remote Intradoc Client (RIDC) Java API Reference
11g Release 1 (11.1.1)

E17274-02


oracle.stellent.ridc.model.serialize
Class HdaBinderSerializer

java.lang.Object
  extended by oracle.stellent.ridc.model.serialize.HdaBinderSerializer


public class HdaBinderSerializer
extends java.lang.Object

Serializes a databinder to HDA format


Field Summary
static java.lang.String[] DATA_TYPES
          Internally used data types that are supported in the HDA format that the databinder writes to, and reads from.

 

Constructor Summary
HdaBinderSerializer(java.lang.String encoding, DataFactory dataFactory)
           

 

Method Summary
protected  byte[] getBytes(java.lang.String str)
          Utility function to obtain a byte stream based on the encoding set, or to the default system encoding if no encoding is set.
 DataFactory getDataFactory()
           
 java.lang.String getEncoding()
          Obtain the file encoding for the files referenced in this object.
protected  int getFieldType(java.lang.String fieldData)
          Parse and get the numerical value of the field type given a string.
protected  int getTypeIndex(DataResultSet.Field.Type type)
          This returns the index (or the numerical value) of the type.
protected  void packageOptionList(java.io.Writer writer, java.util.List<java.lang.String> options, java.lang.String name)
          Turns the option list into a hda formatted string, and writes the data to the writer.
protected  void packageProperties(java.io.Writer writer, DataObject dataObject, java.lang.String name)
          Turns the properties object into a hda formatted string, and writes the data to the writer.
protected  void packageResultSet(java.io.Writer writer, DataResultSet aSet, java.lang.String name)
          Turns the result set into a hda formatted string, and writes the data to the writer.
 DataBinder parseBinder(java.io.InputStream inputStream)
          Parses a BufferedReader object, and loads up the data into a new DataBinder object
 DataBinder parseBinder(java.io.Reader inputReader)
          Parses a BufferedReader object, and loads up the data into a new DataBinder object
protected  boolean parseNameValue(DataObject dataObject, java.lang.String envPair, java.lang.String delimiter)
          Split a name-value pair separated by a delimiter into its parts, and place the value in the local data
protected  void parseOptionList(DataBinder dataBinder, java.lang.String name, java.io.BufferedReader reader)
          Parse the buffered reader, and create a new option list with the data contained in it, until the @end line is reached.
protected  boolean parseProperties(DataBinder dataBinder, java.lang.String name, java.io.BufferedReader reader)
          Parse hda formatted properties, and merge the values into the local data if those values are not from the environment.
protected  void parseResultSet(DataBinder dataBinder, java.lang.String rName, java.io.BufferedReader reader)
          Parses the LWDataBinder object for the result set with a certain name
protected  java.lang.String readLine(java.io.BufferedReader reader, boolean suppress)
          Reads a line from a reader, and throws an exception if it cannot, unless 'suppress' is set to true.
protected  boolean readProperties(java.io.BufferedReader reader, DataObject props, java.lang.String endMark, boolean isJava)
          Read properties values in from a buffered reader and into a properties object.
protected  java.util.List<DataResultSet.Field> readResultSetHeader(java.io.BufferedReader bReader)
          Parses the column information for the result set from a character stream
protected  void readToEnd(java.io.BufferedReader reader)
          Advance the reader until the '@end' value is found on a line.
 void serializeBinder(java.io.OutputStream outputStream, DataBinder dataBinder)
          Writes out the local data, option lists, and result sets in hda format.
 void serializeBinder(java.io.Writer writer, DataBinder dataBinder)
          Writes out the local data, option lists, and result sets in hda format.
 void setEncoding(java.lang.String encoding)
          Set the encoding for the files referenced in this object.

 

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

 

Field Detail

DATA_TYPES

public static final java.lang.String[] DATA_TYPES
Internally used data types that are supported in the HDA format that the databinder writes to, and reads from.

Constructor Detail

HdaBinderSerializer

public HdaBinderSerializer(java.lang.String encoding,
                           DataFactory dataFactory)

Method Detail

getDataFactory

public DataFactory getDataFactory()

parseBinder

public DataBinder parseBinder(java.io.InputStream inputStream)
                       throws java.io.IOException
Parses a BufferedReader object, and loads up the data into a new DataBinder object
Parameters:
inputStream - the binder input stream
Returns:
the binder
Throws:
java.io.IOException

parseBinder

public DataBinder parseBinder(java.io.Reader inputReader)
                       throws java.io.IOException
Parses a BufferedReader object, and loads up the data into a new DataBinder object
Parameters:
inputReader - the reader containing the binder characters
Returns:
the binder
Throws:
java.io.IOException

serializeBinder

public void serializeBinder(java.io.OutputStream outputStream,
                            DataBinder dataBinder)
                     throws java.io.IOException
Writes out the local data, option lists, and result sets in hda format.
Parameters:
outputStream - the stream to write the binder
dataBinder - the data binder to serialize
Throws:
java.io.IOException - if an exception occurs during serialization

serializeBinder

public void serializeBinder(java.io.Writer writer,
                            DataBinder dataBinder)
                     throws java.io.IOException
Writes out the local data, option lists, and result sets in hda format.
Parameters:
writer - the writer to send the binder
dataBinder - the data binder to serialize
Throws:
java.io.IOException - if an exception occurs during serialization

parseProperties

protected boolean parseProperties(DataBinder dataBinder,
                                  java.lang.String name,
                                  java.io.BufferedReader reader)
                           throws java.io.IOException
Parse hda formatted properties, and merge the values into the local data if those values are not from the environment.
Parameters:
dataBinder - the data binder
name - the properties name
reader - the input reader
Returns:
true if successful
Throws:
java.io.IOException

readProperties

protected boolean readProperties(java.io.BufferedReader reader,
                                 DataObject props,
                                 java.lang.String endMark,
                                 boolean isJava)
                          throws java.io.IOException
Read properties values in from a buffered reader and into a properties object.
Parameters:
reader - the input reader
props - the data object to send the properties
endMark - the end mark to look for
isJava - true if this is a java-based request
Returns:
true if the parsing was successful
Throws:
java.io.IOException

parseNameValue

protected boolean parseNameValue(DataObject dataObject,
                                 java.lang.String envPair,
                                 java.lang.String delimiter)
Split a name-value pair separated by a delimiter into its parts, and place the value in the local data
Parameters:
dataObject - the dataObject to store the result
envPair - the encoded name/value pair
delimiter - the delimiting character in the envPair
Returns:
true if successful

readToEnd

protected void readToEnd(java.io.BufferedReader reader)
                  throws java.io.IOException
Advance the reader until the '@end' value is found on a line.
Parameters:
reader - the input reader
Throws:
java.io.IOException

parseOptionList

protected void parseOptionList(DataBinder dataBinder,
                               java.lang.String name,
                               java.io.BufferedReader reader)
                        throws java.io.IOException
Parse the buffered reader, and create a new option list with the data contained in it, until the @end line is reached. The option list will then be placed in this DataBinder object
Throws:
java.io.IOException

readLine

protected java.lang.String readLine(java.io.BufferedReader reader,
                                    boolean suppress)
                             throws java.io.IOException
Reads a line from a reader, and throws an exception if it cannot, unless 'suppress' is set to true.
Throws:
java.io.IOException

parseResultSet

protected void parseResultSet(DataBinder dataBinder,
                              java.lang.String rName,
                              java.io.BufferedReader reader)
                       throws java.io.IOException
Parses the LWDataBinder object for the result set with a certain name
Parameters:
rName - The name of the result set
reader - A character stream to be parsed to find the result set
Throws:
java.io.IOException

readResultSetHeader

protected java.util.List<DataResultSet.Field> readResultSetHeader(java.io.BufferedReader bReader)
                                                           throws java.io.IOException
Parses the column information for the result set from a character stream
Parameters:
bReader - Character stream containing the result set information
Returns:
The number of fields in the parsed result set.
Throws:
java.io.IOException

getTypeIndex

protected int getTypeIndex(DataResultSet.Field.Type type)
This returns the index (or the numerical value) of the type.
Parameters:
type - the field type
Returns:
the numerical value of the type

getFieldType

protected int getFieldType(java.lang.String fieldData)
Parse and get the numerical value of the field type given a string. The field type is either the first integer that is in the string.
Parameters:
fieldData -
Returns:

packageProperties

protected void packageProperties(java.io.Writer writer,
                                 DataObject dataObject,
                                 java.lang.String name)
                          throws java.io.IOException
Turns the properties object into a hda formatted string, and writes the data to the writer.
Throws:
java.io.IOException

packageResultSet

protected void packageResultSet(java.io.Writer writer,
                                DataResultSet aSet,
                                java.lang.String name)
                         throws java.io.IOException
Turns the result set into a hda formatted string, and writes the data to the writer.
Throws:
java.io.IOException

packageOptionList

protected void packageOptionList(java.io.Writer writer,
                                 java.util.List<java.lang.String> options,
                                 java.lang.String name)
                          throws java.io.IOException
Turns the option list into a hda formatted string, and writes the data to the writer.
Throws:
java.io.IOException

getBytes

protected byte[] getBytes(java.lang.String str)
                   throws java.io.UnsupportedEncodingException
Utility function to obtain a byte stream based on the encoding set, or to the default system encoding if no encoding is set.
Throws:
java.io.UnsupportedEncodingException

getEncoding

public java.lang.String getEncoding()
Obtain the file encoding for the files referenced in this object.

setEncoding

public void setEncoding(java.lang.String encoding)
Set the encoding for the files referenced in this object.

Skip navigation links

Oracle® Fusion Middleware Remote Intradoc Client (RIDC) Java API Reference
11g Release 1 (11.1.1)

E17274-02


Copyright © 2008, 2011, Oracle and/or its affiliates. All rights reserved.