Class RobotParser
java.lang.Object
|
+--RobotParser
- Direct Known Subclasses:
- DefaultRobotParser
- public abstract class RobotParser
- extends java.lang.Object
An abstract class to encapsulate the functionality required to properly
parse a robot configuration file, and construct the robot's internal
representation, including a 3D representation.
- See Also:
Robot
Field Summary |
static java.lang.String |
DEFAULT_PARSER
The default RobotParser class. |
Constructor Summary |
protected |
RobotParser()
Protected constructor. |
Method Summary |
abstract Robot |
getRobot()
Returns the Robot object created from parsing the Reader stream. |
static RobotParser |
loadParser(java.lang.String s)
Loads the RobotParser class specified by the given String. |
abstract void |
read(java.io.Reader reader)
Parses the Reader for configuration information. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEFAULT_PARSER
public static final java.lang.String DEFAULT_PARSER
- The default RobotParser class.
RobotParser
protected RobotParser()
- Protected constructor. Use
loadParser
to load a specific
RobotParser instance instead of instantiating a RobotParser directly.
read
public abstract void read(java.io.Reader reader)
throws RobotParserException
- Parses the Reader for configuration information.
- Parameters:
r
- the Reader to parse for configuration information.- Throws:
- RobotParserException - indicates an error parsing the Reader.
getRobot
public abstract Robot getRobot()
- Returns the Robot object created from parsing the Reader stream.
- Returns:
- the Robot object.
loadParser
public static final RobotParser loadParser(java.lang.String s)
throws RobotParserException
- Loads the RobotParser class specified by the given String.
- Parameters:
s
- the name of the RobotParser class to be loaded.- Returns:
- an instance of the requested RobotParser class.
- Throws:
- RobotParserException - indicates an error loading the class.