Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * JBoss, Home of Professional Open Source
  * Copyright 2006, JBoss Inc., and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * This is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as
  * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
 package org.jboss.xb.binding.sunday.unmarshalling;
 
 import  org.jboss.logging.Logger;

SingletonSchemaResolverFactory.

Author(s):
Adrian Brock
Version:
$Revision: 2283 $
 
 {
   
The log
 
    private static final Logger log = Logger.getLogger(SingletonSchemaResolverFactory.class);

   
The factory instance
 
    private static final SingletonSchemaResolverFactory singleton = new SingletonSchemaResolverFactory();

   
The resolver
 
    private final DefaultSchemaResolver resolver = new DefaultSchemaResolver();

   
Get the factory instance

Returns:
the instance
 
    {
       return ;
    }

   
Create a new SingletonSchemaResolverFactory.
 
    {
       addSchema("urn:jboss:aop-beans:1.0""org.jboss.aop.microcontainer.beans.xml.AOPBeansSchemaInitializer".);
       addSchema("urn:jboss:bean-deployer""org.jboss.kernel.plugins.deployment.xml.BeanSchemaInitializer".);
       addSchema("urn:jboss:bean-deployer:2.0""org.jboss.kernel.plugins.deployment.xml.BeanSchemaInitializer20".);
       addSchema("urn:jboss:javabean:1.0""org.jboss.javabean.plugins.xml.JavaBeanSchemaInitializer".);
       addSchema("urn:jboss:javabean:2.0""org.jboss.javabean.plugins.xml.JavaBeanSchemaInitializer20".);
       addSchema("urn:jboss:spring-beans:2.0""org.jboss.spring.deployment.xml.SpringSchemaInitializer".);
       addSchema("urn:jboss:policy:1.0""org.jboss.kernel.plugins.deployment.xml.PolicySchemaInitializer".);
       addSchema("urn:jboss:osgi-beans:1.0""org.jboss.osgi.deployment.xml.OSGiSchemaInitializer".);
       addSchema("urn:jboss:seam-components:1.0""org.jboss.seam.ioc.microcontainer.xml.SeamSchemaInitializer".);
    }
 
    {
       return ;
    }

   
Add a schema

Parameters:
namespace the namespace
initializer the initializer
Returns:
true when added
 
    protected boolean addSchema(String namespaceString initializer)
    {
       try
       {
          .addSchemaInitializer(namespaceinitializer);
          .trace("Mapped initializer '" + namespace + "' to '" + initializer + "'");
          return true;
       }
       catch (Exception ignored)
       {
          .trace("Ignored: "ignored);
          return false;
       }
    }

   
Add a schema

Parameters:
namespace the namespace
initializer the initializer
parseAnnotations whether to parse annotations
Returns:
true when added
   protected boolean addSchema(String namespaceString initializerBoolean parseAnnotations)
   {
      if (addSchema(namespaceinitializer) == false)
         return false;
      setParseAnnotations(namespaceparseAnnotations);
      return true;
   }

   
Add a schema

Parameters:
namespace the namespace
initializer the initializer
location the location
Returns:
true when added
   protected boolean addSchema(String namespaceString initializerString location)
   {
      if (addSchema(namespaceinitializer) == false)
         return false;
      try
      {
         .addSchemaLocation(namespacelocation);
         .trace("Mapped location '" + namespace + "' to '" + location + "'");
         return true;
      }
      catch (Exception ignored)
      {
         .trace("Ignored: "ignored);
         return false;
      }
   }

   
Add a schema

Parameters:
namespace the namespace
initializer the initializer
location the location
parseAnnotations whether to parse annotations
Returns:
true when added
   protected boolean addSchema(String namespaceString initializerString locationBoolean parseAnnotations)
   {
      if (addSchema(namespaceinitializerlocation) == false)
         return false;
      setParseAnnotations(namespaceparseAnnotations);
      return true;
   }

   
Set the parse annotations for a schema

Parameters:
namespace the namespace
parseAnnotations whether to parse annotations
   protected void setParseAnnotations(String namespaceBoolean parseAnnotations)
   {
      .addSchemaParseAnnotations(namespaceparseAnnotations);
      .trace("Parse annotations '" + namespace + "' set to '" + parseAnnotations + "'");
   }
New to GrepCode? Check out our FAQ X