com.ibm.commerce.component.servicemapper

Class ServiceMappingConfigurationBuilder

  • java.lang.Object
    • com.ibm.commerce.component.servicemapper.ServiceMappingConfigurationBuilder


  • public class ServiceMappingConfigurationBuilder
    extends java.lang.Object
    This class builds service mapping configurations from various sources
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        The name of this class
      • MAPPING_CONFIG_TAG

        public static java.lang.String MAPPING_CONFIG_TAG
        The name of the XML tag that is corresponding to a service mapping configuration
      • MAPPING_GROUP_TAG

        public static final java.lang.String MAPPING_GROUP_TAG
        The tag name of a service mapping group
        See Also:
        Constant Field Values
      • MAPPING_GROUP_NAME_ATTR

        public static final java.lang.String MAPPING_GROUP_NAME_ATTR
        The name of the name attribute of a service mapping group
        See Also:
        Constant Field Values
      • MAPPING_GROUP_SERVICE_NAME_ATTR

        public static final java.lang.String MAPPING_GROUP_SERVICE_NAME_ATTR
        The name of the service attribute of a service mapping group
        See Also:
        Constant Field Values
      • MAPPING_GROUP_SERVICE_INPUT_TYPE_ATTR

        public static final java.lang.String MAPPING_GROUP_SERVICE_INPUT_TYPE_ATTR
        The name of the attribute for service input type
        See Also:
        Constant Field Values
      • MAPPING_GROUP_DEFAULT_NOUN_TYPE_ATTR

        public static final java.lang.String MAPPING_GROUP_DEFAULT_NOUN_TYPE_ATTR
        The name of the attribute for default noun type of a service mapping group
        See Also:
        Constant Field Values
      • MAPPING_GROUP_VERB_TYPE_ATTR

        public static final java.lang.String MAPPING_GROUP_VERB_TYPE_ATTR
        The name of the attribute for verb type of a service input
        See Also:
        Constant Field Values
      • MAPPING_TAG

        public static final java.lang.String MAPPING_TAG
        The tag name of a service mapping
        See Also:
        Constant Field Values
      • MAPPING_SOURCE_ATTR

        public static final java.lang.String MAPPING_SOURCE_ATTR
        The name of the source attribute in a service mapping
        See Also:
        Constant Field Values
      • MAPPING_TARGET_ATTR

        public static final java.lang.String MAPPING_TARGET_ATTR
        The name of the target attribute in a service mapping
        See Also:
        Constant Field Values
      • MAPPING_ACTION_ATTR

        public static final java.lang.String MAPPING_ACTION_ATTR
        The name of the action attribute in a service mapping
        See Also:
        Constant Field Values
      • MAPPING_NOUN_TYPE_ATTR

        public static final java.lang.String MAPPING_NOUN_TYPE_ATTR
        The name of the attribute for noun type in a service mapping
        See Also:
        Constant Field Values
      • XPATH_MAPPING_GROUPS

        public static final java.lang.String XPATH_MAPPING_GROUPS
        The XPath that describes all the service mapping groups in the mapping file
    • Constructor Detail

      • ServiceMappingConfigurationBuilder

        public ServiceMappingConfigurationBuilder()
    • Method Detail

      • buildMappingConfiguration

        public ServiceMappingConfiguration buildMappingConfiguration(java.io.File mappingFile)
                                                              throws java.io.FileNotFoundException,
                                                                     javax.xml.parsers.FactoryConfigurationError,
                                                                     java.lang.Exception
        Builds a service mapping configuration based on a given service mapping file
        Parameters:
        mappingFile - the service mapping file that contains the mapping information
        Returns:
        A non-null ServiceMappingConfiguration object
        Throws:
        java.io.FileNotFoundException - thrown if the given File is not associated with any physical file.
        org.xml.sax.SAXException - thrown if the given file is invalid or ill-formed
        java.io.IOException - thrown if the file can not be read while being parsed
        FactoryConfigurationException - thrown if a XML DOM builder can not be retrieved due to factory configuration problems
        javax.xml.parsers.ParserConfigurationException - thrown if the parser used to parse the configuration file is not properly configured
        javax.xml.transform.TransformerException - thrown if the XPath expressions being used can not be processed properly
        java.lang.ClassNotFoundException - thrown if a type specified in the configuration file has no corresponding classes defined
        javax.xml.parsers.FactoryConfigurationError
        java.lang.Exception
      • buildMappingConfiguration

        public ServiceMappingConfiguration buildMappingConfiguration(java.io.InputStream mappingInfo)
                                                              throws org.xml.sax.SAXException,
                                                                     java.io.IOException,
                                                                     javax.xml.parsers.FactoryConfigurationError,
                                                                     javax.xml.parsers.ParserConfigurationException,
                                                                     javax.xml.transform.TransformerException,
                                                                     java.lang.ClassNotFoundException
        Builds a service mapping configuration based on a given service mapping stream.
        Parameters:
        mappingInfo - An InputStream that contains the mapping information
        Returns:
        A non-null ServiceMappingConfiguration object. An empty ServiceMappingConfiguration when the given input stream is null.
        Throws:
        java.io.FileNotFoundException - thrown if the given File is not associated with any physical file.
        org.xml.sax.SAXException - thrown if the given file is invalid or ill-formed
        java.io.IOException - thrown if the file can not be read while being parsed
        FactoryConfigurationException - thrown if the XML DOM builder can not be retrieved due to factory configuration problems
        javax.xml.parsers.ParserConfigurationException - thrown if the parser used to parse the configuration file is not properly configured
        javax.xml.transform.TransformerException - thrown if the XPath expressions being used can not be processed properly
        java.lang.ClassNotFoundException - thrown if a type specified in the configuration file has no corresponding classes defined
        javax.xml.parsers.FactoryConfigurationError
      • buildMappingConfiguration

        public void buildMappingConfiguration(java.lang.String fileName,
                                              ServiceMappingConfiguration configuration)
                                       throws org.xml.sax.SAXException,
                                              java.io.IOException,
                                              javax.xml.parsers.FactoryConfigurationError,
                                              javax.xml.parsers.ParserConfigurationException,
                                              javax.xml.transform.TransformerException,
                                              java.lang.ClassNotFoundException
        Builds the given configuration with the data in the given file. Upon exceptions being thrown, the given configuration may be partially built. It is the caller's responsibility to clean it up, just in case the half-baked configuration is still useful.
        Parameters:
        fileName - the name of the configuration file
        configuration - a non-null ServiceMappingConfiguration instance
        Throws:
        java.io.FileNotFoundException - thrown if the given File is not associated with any physical file.
        org.xml.sax.SAXException - thrown if the given file is invalid or ill-formed
        java.io.IOException - thrown if the file can not be read while being parsed, or when the input stream can not be closed
        FactoryConfigurationException - thrown if a XML DOM builder can not be retrieved due to factory configuration problems
        javax.xml.parsers.ParserConfigurationException - thrown if the parser used to parse the configuration file is not properly configured
        javax.xml.transform.TransformerException - thrown if the XPath expressions being used can not be processed properly
        java.lang.ClassNotFoundException - thrown if a type specified in the configuration file has no corresponding classes defined
        javax.xml.parsers.FactoryConfigurationError
        See Also:
        ServiceMappingConfiguration.clear()