org.robokind.impl.motion.config
Class RobotConfigXMLReader

java.lang.Object
  extended by org.robokind.impl.motion.config.RobotConfigXMLReader
All Implemented Interfaces:
org.robokind.api.common.services.ServiceConfigurationLoader<org.robokind.api.motion.servos.config.ServoRobotConfig,org.apache.commons.configuration.HierarchicalConfiguration>

public class RobotConfigXMLReader
extends Object
implements org.robokind.api.common.services.ServiceConfigurationLoader<org.robokind.api.motion.servos.config.ServoRobotConfig,org.apache.commons.configuration.HierarchicalConfiguration>

Utility methods for reading an XML RobotConfig.

Author:
Matthew Stevenson

Field Summary
static String CONFIG_TYPE
          Config format version name.
static String CONFIG_VERSION
          Config format version number.
static org.robokind.api.common.config.VersionProperty VERSION
          Config format VersionProperty.
static String XML_CONFIG_VERSION_TYPE
          Config format VersionProperty type attribute.
static String XML_CONTROLLER
          ServoController XML Element.
static String XML_CONTROLLER_TYPE_VERSION
          Controller Type VersionProperty type attribute.
static String XML_CONTROLLERS
          JointControllers XML Element.
static String XML_JOINT
          Joint config XML Element.
static String XML_JOINT_CONFIG
          Joint configs XML Element.
static String XML_JOINT_JOINT_ID
          Joint id XML attribute.
static String XML_JOINT_NAME
          Joint name XML attribute.
static String XML_JOINT_SERVO_CONTROLLER_ID
          Joint id XML attribute.
static String XML_JOINT_SERVO_ID
          Joint id XML attribute.
static String XML_ROBOT_CONFIG
          Robot XML Element.
static String XML_ROBOT_ID
          Robot XML Id.
static String XML_SERVO_CONTROLLER_CONFIG
          Controller parameters XML element name.
static String XML_VERSION_PROPERTIES
          Version properties XML element name.
 
Fields inherited from interface org.robokind.api.common.services.ServiceConfigurationLoader
PROP_CONFIG_FORMAT_VERSION, PROP_PARAMETER_CLASS, PROP_SERVICE_CONFIG_CLASS
 
Constructor Summary
RobotConfigXMLReader()
           
 
Method Summary
 Class<org.robokind.api.motion.servos.config.ServoRobotConfig> getConfigurationClass()
           
 org.robokind.api.common.config.VersionProperty getConfigurationFormat()
           
 Class<org.apache.commons.configuration.HierarchicalConfiguration> getParameterClass()
           
 org.robokind.api.motion.servos.config.ServoRobotConfig loadConfiguration(org.apache.commons.configuration.HierarchicalConfiguration param)
           
static org.robokind.api.motion.servos.config.ServoRobotConfig readConfig(org.osgi.framework.BundleContext context, org.apache.commons.configuration.HierarchicalConfiguration xml)
          Reads a RobotConfig from the XML node.
static org.robokind.api.motion.servos.config.ServoRobotConfig readConfig(org.osgi.framework.BundleContext context, String path)
          Reads a RobotConfig from the file path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_TYPE

public static final String CONFIG_TYPE
Config format version name.

See Also:
Constant Field Values

CONFIG_VERSION

public static final String CONFIG_VERSION
Config format version number.

See Also:
Constant Field Values

VERSION

public static final org.robokind.api.common.config.VersionProperty VERSION
Config format VersionProperty.


XML_ROBOT_CONFIG

public static final String XML_ROBOT_CONFIG
Robot XML Element.

See Also:
Constant Field Values

XML_ROBOT_ID

public static final String XML_ROBOT_ID
Robot XML Id.

See Also:
Constant Field Values

XML_JOINT_CONFIG

public static final String XML_JOINT_CONFIG
Joint configs XML Element.

See Also:
Constant Field Values

XML_JOINT

public static final String XML_JOINT
Joint config XML Element.

See Also:
Constant Field Values

XML_JOINT_JOINT_ID

public static final String XML_JOINT_JOINT_ID
Joint id XML attribute.

See Also:
Constant Field Values

XML_JOINT_SERVO_CONTROLLER_ID

public static final String XML_JOINT_SERVO_CONTROLLER_ID
Joint id XML attribute.

See Also:
Constant Field Values

XML_JOINT_SERVO_ID

public static final String XML_JOINT_SERVO_ID
Joint id XML attribute.

See Also:
Constant Field Values

XML_JOINT_NAME

public static final String XML_JOINT_NAME
Joint name XML attribute.

See Also:
Constant Field Values

XML_CONTROLLERS

public static final String XML_CONTROLLERS
JointControllers XML Element.

See Also:
Constant Field Values

XML_CONTROLLER

public static final String XML_CONTROLLER
ServoController XML Element.

See Also:
Constant Field Values

XML_VERSION_PROPERTIES

public static final String XML_VERSION_PROPERTIES
Version properties XML element name.

See Also:
Constant Field Values

XML_CONTROLLER_TYPE_VERSION

public static final String XML_CONTROLLER_TYPE_VERSION
Controller Type VersionProperty type attribute. Used to specify the type of ServoController to use.

See Also:
Constant Field Values

XML_CONFIG_VERSION_TYPE

public static final String XML_CONFIG_VERSION_TYPE
Config format VersionProperty type attribute. Used to specify the type of ServoControllerConfig reader to use.

See Also:
Constant Field Values

XML_SERVO_CONTROLLER_CONFIG

public static final String XML_SERVO_CONTROLLER_CONFIG
Controller parameters XML element name.

See Also:
Constant Field Values
Constructor Detail

RobotConfigXMLReader

public RobotConfigXMLReader()
Method Detail

readConfig

public static org.robokind.api.motion.servos.config.ServoRobotConfig readConfig(org.osgi.framework.BundleContext context,
                                                                                String path)
Reads a RobotConfig from the file path.

Parameters:
context - BundleContext to use for loading a config reader
path - path to the XML file
Returns:
RobotConfig from the file path

readConfig

public static org.robokind.api.motion.servos.config.ServoRobotConfig readConfig(org.osgi.framework.BundleContext context,
                                                                                org.apache.commons.configuration.HierarchicalConfiguration xml)
Reads a RobotConfig from the XML node.

Parameters:
context - BundleContext to use for loading a config reader
xml - XML node
Returns:
RobotConfig from the XML node

getConfigurationFormat

public org.robokind.api.common.config.VersionProperty getConfigurationFormat()
Specified by:
getConfigurationFormat in interface org.robokind.api.common.services.ServiceConfigurationLoader<org.robokind.api.motion.servos.config.ServoRobotConfig,org.apache.commons.configuration.HierarchicalConfiguration>

loadConfiguration

public org.robokind.api.motion.servos.config.ServoRobotConfig loadConfiguration(org.apache.commons.configuration.HierarchicalConfiguration param)
Specified by:
loadConfiguration in interface org.robokind.api.common.services.ServiceConfigurationLoader<org.robokind.api.motion.servos.config.ServoRobotConfig,org.apache.commons.configuration.HierarchicalConfiguration>

getConfigurationClass

public Class<org.robokind.api.motion.servos.config.ServoRobotConfig> getConfigurationClass()
Specified by:
getConfigurationClass in interface org.robokind.api.common.services.ServiceConfigurationLoader<org.robokind.api.motion.servos.config.ServoRobotConfig,org.apache.commons.configuration.HierarchicalConfiguration>

getParameterClass

public Class<org.apache.commons.configuration.HierarchicalConfiguration> getParameterClass()
Specified by:
getParameterClass in interface org.robokind.api.common.services.ServiceConfigurationLoader<org.robokind.api.motion.servos.config.ServoRobotConfig,org.apache.commons.configuration.HierarchicalConfiguration>


Copyright © 2011. All Rights Reserved.