Xj3D VRML/X3D Code API

org.web3d.vrml.lang
Class ComponentInfo

java.lang.Object
  extended byorg.web3d.vrml.lang.ComponentInfo

public class ComponentInfo
extends java.lang.Object

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
ComponentInfo(ComponentInfo info, int level)
          Copy constructor for creating a derived version of this component info but with a different level set.
ComponentInfo(java.lang.String name, int level)
          Construct a basic component description that just has a name and level.
ComponentInfo(java.lang.String name, int level, java.lang.String title, java.lang.String url, java.util.Map pkgs)
          Construct a full component description.
 
Method Summary
 int getLevel()
          Get the level of the component.
 java.lang.String getName()
          Get the name of this component.
 java.lang.String getPackage(java.lang.String renderer)
          Get the name of the java package that the rendering classes will be sourced from for the given renderer type.
 java.lang.String getProviderURL()
          Get the URL of the provider.
 java.lang.String getTitle()
          Get the title of this component.
 java.lang.String toX3DString()
          Return a formatted string version of this component that conforms to the X3D 1.0 specification for VRML file encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentInfo

public ComponentInfo(java.lang.String name,
                     int level)
Construct a basic component description that just has a name and level.

Parameters:
name - The name of the component
level - The level of the component
Throws:
java.lang.IllegalArgumentException - The name was null or level < 1

ComponentInfo

public ComponentInfo(java.lang.String name,
                     int level,
                     java.lang.String title,
                     java.lang.String url,
                     java.util.Map pkgs)
              throws java.lang.IllegalArgumentException
Construct 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 component
level - The level of the component
title - The title of this component
url - The provider URL
pkgs - The Java package that this component is sourced from
Throws:
java.lang.IllegalArgumentException - The name was null or level < 1

ComponentInfo

public ComponentInfo(ComponentInfo info,
                     int level)
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 from
level - The new level to use
Throws:
java.lang.IllegalArgumentException - level < 1
Method Detail

getName

public java.lang.String getName()
Get the name of this component.

Returns:
name The name of the component

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

public java.lang.String 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

public java.lang.String 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

public java.lang.String getPackage(java.lang.String renderer)
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

public java.lang.String 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 the COMPONENT keyword, as per spec.

Returns:
A correctly formatted string.

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium