Home » xml-commons-external-1.4.01-src » javax » xml » rpc » encoding » [javadoc | source]

    1   /*
    2    * JBoss, Home of Professional Open Source.
    3    * Copyright 2006, Red Hat Middleware LLC, and individual contributors
    4    * as indicated by the @author tags. See the copyright.txt file in the
    5    * distribution for a full listing of individual contributors.
    6    *
    7    * This is free software; you can redistribute it and/or modify it
    8    * under the terms of the GNU Lesser General Public License as
    9    * published by the Free Software Foundation; either version 2.1 of
   10    * the License, or (at your option) any later version.
   11    *
   12    * This software is distributed in the hope that it will be useful,
   13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   15    * Lesser General Public License for more details.
   16    *
   17    * You should have received a copy of the GNU Lesser General Public
   18    * License along with this software; if not, write to the Free
   19    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   20    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   21    */
   22   package javax.xml.rpc.encoding;
   23   
   24   import java.io.Serializable;
   25   
   26   /**
   27    * This defines a registry of TypeMapping instances for encoding styles.
   28    *  
   29    * @author Scott.Stark@jboss.org
   30    * @author Thomas.Diesler@jboss.org
   31    */
   32   public interface TypeMappingRegistry extends Serializable
   33   {
   34      /**
   35       * Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.
   36       */
   37      public void clear();
   38   
   39      /**
   40       * Gets the registered default TypeMapping instance.
   41       * This method returns null if there is no registered default TypeMapping in the registry.
   42       * @return The registered default TypeMapping instance or null
   43       */
   44      public TypeMapping getDefaultTypeMapping();
   45   
   46      /**
   47       * Registers the TypeMapping instance that is default for all encoding styles supported by the TypeMappingRegistry.
   48       * A default TypeMapping should include serializers and deserializers that are independent of and usable with any
   49       * encoding style. Successive invocations of the registerDefault method replace any existing default TypeMapping instance.
   50       *
   51       * If the default TypeMapping is registered, any other TypeMapping instances registered through the
   52       * TypeMappingRegistry.register method (for a set of encodingStyle URIs) override the default TypeMapping.
   53       *
   54       * @param mapping TypeMapping instance
   55       * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of the default TypeMapping
   56       */
   57      public void registerDefault(TypeMapping mapping);
   58   
   59      /**
   60       * Creates a new empty TypeMapping object.
   61       * @return TypeMapping instance
   62       */
   63      public TypeMapping createTypeMapping();
   64   
   65      /**
   66       * Returns the registered TypeMapping for the specified encodingStyle URI. If there is no registered TypeMapping for
   67       * the specified encodingStyleURI, this method returns null.
   68       * @param encodingStyleURI Encoding style specified as an URI
   69       * @return TypeMapping for the specified encodingStyleURI or null
   70       */
   71      public TypeMapping getTypeMapping(String encodingStyleURI);
   72   
   73      /**
   74       * Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.
   75       * @return Array of the registered encodingStyle URIs
   76       */
   77      public String[] getRegisteredEncodingStyleURIs();
   78   
   79      /**
   80       * Registers a TypeMapping instance with the TypeMappingRegistry.
   81       * This method replaces any existing registered TypeMapping instance for the specified encodingStyleURI.
   82       *
   83       * @param encodingStyleURI An encoding style specified as an URI.
   84       * @param mapping TypeMapping instance
   85       * @return Previous TypeMapping associated with the specified encodingStyleURI, or null if there was no
   86       * TypeMapping associated with the specified encodingStyleURI
   87       * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of the TypeMapping for the specified encodingStyleURI.
   88       */
   89      public TypeMapping register(String encodingStyleURI, TypeMapping mapping);
   90   
   91      /**
   92       * Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.
   93       * @param encodingStyleURI Encoding style specified as an URI
   94       * @return TypeMapping instance that has been unregistered or null if there was no
   95       * TypeMapping registered for the specified encodingStyleURI
   96       */
   97      public TypeMapping unregisterTypeMapping(String encodingStyleURI);
   98   
   99      /**
  100       * Removes a TypeMapping from the TypeMappingRegistry.
  101       * A TypeMapping is associated with 1 or more encodingStyleURIs. This method unregisters the specified
  102       * TypeMapping instance from all associated encodingStyleURIs and then removes this TypeMapping
  103       * instance from the registry.
  104       *
  105       * @param mapping TypeMapping to be removed
  106       * @return true if specified TypeMapping is removed from the TypeMappingRegistry;
  107       * false if the specified TypeMapping was not in the TypeMappingRegistry
  108       */
  109      public boolean removeTypeMapping(TypeMapping mapping);
  110   }

Home » xml-commons-external-1.4.01-src » javax » xml » rpc » encoding » [javadoc | source]