JACK 5.4 JACOB Application Interface

aos.apib
Class JacobReader

java.lang.Object
  extended byaos.apib.JacobReader

public class JacobReader
extends java.lang.Object

The JacobReader class is used to read in JACOB objects defined either in a file or a String and translate them into Base Objects. It requires a TypeDict to define the various objects it can read in.


Constructor Summary
JacobReader(TypeDict d)
          Constructs a new JacobReader, given the TypeDict, which defines the Jacob Objects that can be read.
 
Method Summary
static void initialize(java.lang.String s)
          A helper method which is equvalent to calling the initialize method on the TypeDict defined in this JacobReader.
static Base read(java.lang.String s)
          This method is used to call the readFromString method on this class, checking first that the JacobReader has been enabled via the setEnabled method.
 Base readFromFile(java.lang.String f)
          Reads a single Jacob object from a text file and returns the Base representation of this object.
 Base readFromString(java.lang.String s)
          Reads a single Jacob object from a String and returns the Base representation of this object.
static void setDict(TypeDict d)
          Sets the TypeDict for this JacobReader, which defines the Jacob Objects that can be read.
static boolean setEnabled(boolean b)
          Sets whether this JacobReader is able to read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JacobReader

public JacobReader(TypeDict d)
Constructs a new JacobReader, given the TypeDict, which defines the Jacob Objects that can be read.

Parameters:
d - the TypeDict which defines Jacob Objects that can be read.
Method Detail

setDict

public static void setDict(TypeDict d)
Sets the TypeDict for this JacobReader, which defines the Jacob Objects that can be read.

Parameters:
d - the TypeDict which defines Jacob Objects that can be read.

initialize

public static void initialize(java.lang.String s)
A helper method which is equvalent to calling the initialize method on the TypeDict defined in this JacobReader.

Parameters:
s - a String of Initializer class names separated by a ":" character.
See Also:
initialize, initialize

read

public static Base read(java.lang.String s)
This method is used to call the readFromString method on this class, checking first that the JacobReader has been enabled via the setEnabled method.

Parameters:
s - a String containing a Jacob Object to be read and converted to a Base Object.

setEnabled

public static boolean setEnabled(boolean b)
Sets whether this JacobReader is able to read. When set to false, the read method will return null. The function of the readFromString and readFromFile methods are not affected by setting this variable.

Parameters:
b - whether this JacobReader is enabled.

readFromString

public Base readFromString(java.lang.String s)
Reads a single Jacob object from a String and returns the Base representation of this object. If the String contains more than one Jacob object, only the first object will be read.

Parameters:
s - a String containing a Jacob Object to be read and converted to a Base Object.

readFromFile

public Base readFromFile(java.lang.String f)
Reads a single Jacob object from a text file and returns the Base representation of this object. If the file contains more than one Jacob object, only the first object will be read.


JACK 5.4 JACOB Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088