Java Doc for ConfigObject.java in  » 6.0-JDK-Modules » java-3d » com » sun » j3d » utils » universe » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.sun.j3d.utils.universe 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.



Field Summary
 Listaliases
     List of alias Strings for this object if it's not an alias itself.
 StringbaseName
     The base name of this object, derived from the configuration command which created it.
protected  ClassLoaderclassLoader
    
 ConfigContainerconfigContainer
     The ConfigContainer in which this ConfigObject is contained.
 ConfigCommandcreatingCommand
     The command that created this class.
 StringinstanceName
     The instance name of this object, as specified in the configuration file.
 booleanisAlias
     If true, this object is an alias to another.
 ConfigObjectoriginal
     If isAlias is true, this references the original object.
 Listproperties
     Configurable properties gathered by this object, represented by the ConfigCommands that set them.
 ClasstargetClass
     The Class object for the target.
 StringtargetClassName
     The name of the target class this object is configuring.
 ObjecttargetObject
     The corresponding target object which this ConfigObject is configuring.


Method Summary
protected  ObjectcreateTargetObject()
     Instantiates the target object.
static  StringerrorMessage(ConfigCommand cmd, String s)
     Constructs an error message from the given string and file information from the given command.
protected  voidevaluateProperties(Class objectClass, Object objectInstance, List properties)
     Evaluate properties for the the given class instance.
protected  ClassgetClassForName(ConfigCommand cmd, String className)
     Return the class for the specified class name string.
protected  ObjectgetNewInstance(ConfigCommand cmd, Class objectClass)
     Return an instance of the class specified by the given class object.
protected  voidinitialize(ConfigCommand c)
     The base initialize() implementation.
protected  booleanisName(Object o)
     Check if the argument is a name string.
protected  voidprocessProperties()
     Evaluate properties for the the given class instance.
 voidsetClassLoader(ClassLoader classLoader)
    
protected  voidsetProperty(ConfigCommand c)
     The base setProperty() implementation.
protected  voidsyntaxError(String s)
     Throws an IllegalArgumentException with the specified description.

Field Detail
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.



classLoader
protected ClassLoader classLoader(Code)



configContainer
ConfigContainer configContainer(Code)
The ConfigContainer in which this ConfigObject is contained.



creatingCommand
ConfigCommand creatingCommand(Code)
The command that created this class.



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.





Method Detail
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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.