| java.lang.Object com.sun.j3d.utils.universe.ConfigObject
All known Subclasses: com.sun.j3d.utils.universe.ConfigViewPlatform, com.sun.j3d.utils.universe.ConfigDevice, com.sun.j3d.utils.universe.ConfigPhysicalBody, com.sun.j3d.utils.universe.ConfigScreen, com.sun.j3d.utils.universe.ConfigSensor, com.sun.j3d.utils.universe.ConfigPhysicalEnvironment, com.sun.j3d.utils.universe.ConfigView, com.sun.j3d.utils.universe.ConfigViewPlatformBehavior,
ConfigObject | class ConfigObject (Code) | | Base class for all configuration objects. A ConfigObject processes
configuration parameters for a target object, which is instantiated after
the configuration file is parsed. The ConfigObject then applies its
configuration properties to the target object.
Generic base implementations are provided for the initialize(),
setProperty(), and processProperties() methods. These implementations
assume target objects that are unknown and thus instantiated via
introspection. Property names are assumed to be method names that take an
array of Objects as a parameter; they are invoked through introspection as
well.
Most ConfigObjects target concrete Java 3D core classes, so these
implementations are usually overridden to instantiate those objects and
call their methods directly.
|
aliases | List aliases(Code) | | List of alias Strings for this object if it's not an alias itself.
|
baseName | String baseName(Code) | | The base name of this object, derived from the configuration command
which created it. This is constructed by stripping off the leading
"New" prefix or the trailing "Attribute", "Property", or "Alias" suffix
of the command name. The name of the ConfigObject subclass which
handles the command is derived by adding "Config" as a prefix to the
base name.
|
configContainer | ConfigContainer configContainer(Code) | | The ConfigContainer in which this ConfigObject is contained.
|
instanceName | String instanceName(Code) | | The instance name of this object, as specified in the configuration
file.
|
isAlias | boolean isAlias(Code) | | If true, this object is an alias to another.
|
original | ConfigObject original(Code) | | If isAlias is true, this references the original object.
|
properties | List properties(Code) | | Configurable properties gathered by this object, represented by the
ConfigCommands that set them.
|
targetClass | Class targetClass(Code) | | The Class object for the target.
|
targetClassName | String targetClassName(Code) | | The name of the target class this object is configuring.
|
targetObject | Object targetObject(Code) | | The corresponding target object which this ConfigObject is configuring.
|
createTargetObject | protected Object createTargetObject()(Code) | | Instantiates the target object.
|
errorMessage | static String errorMessage(ConfigCommand cmd, String s)(Code) | | Constructs an error message from the given string and file information
from the given command.
|
evaluateProperties | protected void evaluateProperties(Class objectClass, Object objectInstance, List properties)(Code) | | Evaluate properties for the the given class instance.
Parameters: objectClass - the class object representing the given class Parameters: objectInstance - the class instance whose methods will be invoked Parameters: properties - list of property setting commands |
getClassForName | protected Class getClassForName(ConfigCommand cmd, String className)(Code) | | Return the class for the specified class name string.
Parameters: className - the name of the class the object representing the class |
getNewInstance | protected Object getNewInstance(ConfigCommand cmd, Class objectClass)(Code) | | Return an instance of the class specified by the given class object.
Parameters: objectClass - the object representing the class a new instance of the class |
initialize | protected void initialize(ConfigCommand c)(Code) | | The base initialize() implementation. This takes a ConfigCommand with
three arguments: the command name, the instance name, and the name of
the target class this ConfigObject is configuring. The command in the
configuration file should have the form:
(New{configType} {instanceName} {className})
For example, (NewDevice tracker com.sun.j3d.input.LogitechTracker) will
first cause ConfigDevice to be instantiated, which will then be
initialized with this method. After all the properties are collected,
ConfigDevice will instantiate com.sun.j3d.input.LogitechTracker,
evaluate its properties, and allow references to it in the
configuration file by the name "tracker".
It's assumed the target class will be instantiated through
introspection and its properties set through introspection as well.
Most config objects (ConfigScreen, ConfigView, ConfigViewPlatform,
ConfigPhysicalBody, and ConfigPhysicalEnvironment) target a concrete
core Java 3D class and will instantiate them directly, so they override
this method.
Parameters: c - the command that created this ConfigObject |
isName | protected boolean isName(Object o)(Code) | | Check if the argument is a name string.
Parameters: o - the object to be checked true if the object is an instance of String |
processProperties | protected void processProperties()(Code) | | Evaluate properties for the the given class instance. The property
names are used as the names of methods to be invoked by the instance.
Each such method takes an array of Objects as its only parameter. The
array will contain Objects corresponding to the property values.
|
setClassLoader | void setClassLoader(ClassLoader classLoader)(Code) | | Parameters: classLoader - the ClassLoader to use when loading the implementationclass for this object |
setProperty | protected void setProperty(ConfigCommand c)(Code) | | The base setProperty() implementation. This implementation assumes the
property needs to be set by introspection on the property name as a
method that accepts an array of Objects. That is, the command in the
configuration file is of the form:
({type}Property {instance name} {method name} {arg0} ... {argn})
For example, (DeviceProperty tracker SerialPort "/dev/ttya") will
invoke the method named "SerialPort" in the object referenced by
"tracker" with an array of 1 Object containing the String
"/dev/ttya".
The property is stored as the original ConfigCommand and is evaluated
after the configuration file has been parsed. It is overridden by
subclasses that instantiate concrete core Java 3D classes with known
method names.
Parameters: c - the command that invoked this method |
syntaxError | protected void syntaxError(String s)(Code) | | Throws an IllegalArgumentException with the specified description.
This is caught by the parser which prints out error diagnostics and
continues parsing if it can.
Parameters: s - string describing the syntax error |
|
|