Package org.web3d.vrml.lang
Class ComponentInfo
java.lang.Object
org.web3d.vrml.lang.ComponentInfo
Description of a single component.
A component description contains many useful pieces of information about the requirements. At the basic level, it is just a name and a level. In addition to that, we can include supplemental information, such as who the provider of that component is, URL information and more.
- Version:
- $Revision: 1.2 $
- Author:
- Justin Couch
-
Constructor Summary
ConstructorsConstructorDescriptionComponentInfo
(String name, int level) Construct a basic component description that just has a name and level.Construct a full component description.ComponentInfo
(ComponentInfo info, int level) Copy constructor for creating a derived version of this component info but with a different level set. -
Method Summary
Modifier and TypeMethodDescriptionint
getLevel()
Get the level of the component.getName()
Get the name of this component.getPackage
(String renderer) Get the name of the java package that the rendering classes will be sourced from for the given renderer type.Get the URL of the provider.getTitle()
Get the title of this component.Return a formatted string version of this component that conforms to the X3D 1.0 specification for VRML file encoding.
-
Constructor Details
-
ComponentInfo
Construct a basic component description that just has a name and level.- Parameters:
name
- The name of the componentlevel
- The level of the component- Throws:
IllegalArgumentException
- The name was null or level < 1
-
ComponentInfo
public ComponentInfo(String name, int level, String title, String url, Map<String, String> pkgs) throws IllegalArgumentExceptionConstruct a full component description. Typically used within a node factory or some other place that knows how to find this information out.- Parameters:
name
- The name of the componentlevel
- The level of the componenttitle
- The title of this componenturl
- The provider URLpkgs
- The Java package that this component is sourced from- Throws:
IllegalArgumentException
- The name was null or level < 1
-
ComponentInfo
Copy constructor for creating a derived version of this component info but with a different level set. Useful for creating instances for individual files.- Parameters:
info
- The source to extract information fromlevel
- The new level to use- Throws:
IllegalArgumentException
- level < 1
-
-
Method Details
-
getName
-
getLevel
public int getLevel()Get the level of the component. A level is always greater than zero. The level information may represent one of two things, depending on how the component info was created. When created as part of a file that is requesting a specific level of support, the level will indicate the requested level, not the maximum available on the system. When this is returned from a query of the system to see what components are available then the level is maximum supported by the implementation.- Returns:
- The level indicator
-
getTitle
Get the title of this component. This is a long-form version that could be used in a UI. If no title is set, will return null.- Returns:
- The title string of this component
-
getProviderURL
Get the URL of the provider. This is used for user interface information to point an end user at someone who has implemented this bit of functionality. It is not used by the system to download the component or its definition.- Returns:
- The URL of the provider as a string
-
getPackage
Get the name of the java package that the rendering classes will be sourced from for the given renderer type. All classes representing nodes in this package will come from here. The renderer name string is undetermined by this implementation and is up to the individual requestor to make sure definitions exist.- Parameters:
renderer
- The name of the renderer for properties- Returns:
- The package name for that renderer or null
-
toX3DString
Return a formatted string version of this component that conforms to the X3D 1.0 specification for VRML file encoding. The string will start with theCOMPONENT
keyword, as per spec.- Returns:
- A correctly formatted string.
-