Java Code Examples for com.sun.org.apache.xalan.internal.utils.ObjectFactory#newInstance()

The following examples show how to use com.sun.org.apache.xalan.internal.utils.ObjectFactory#newInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FuncLoader.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 2
Source File: FuncLoader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 3
Source File: FuncLoader.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 4
Source File: FuncLoader.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 5
Source File: FuncLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 6
Source File: FuncLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 7
Source File: FuncLoader.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 8
Source File: FuncLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 9
Source File: FuncLoader.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 10
Source File: FuncLoader.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}
 
Example 11
Source File: FuncLoader.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a Function instance that this instance is liaisoning for.
 *
 * @return non-null reference to Function derivative.
 *
 * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
 *    IllegalAccessException, or InstantiationException is thrown.
 */
Function getFunction() throws TransformerException
{
  try
  {
    String className = m_funcName;
    if (className.indexOf(".") < 0) {
      className = "com.sun.org.apache.xpath.internal.functions." + className;
    }
    //hack for loading only built-in function classes.
    String subString = className.substring(0,className.lastIndexOf('.'));
    if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
         subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
          throw new TransformerException("Application can't install his own xpath function.");
    }

    return (Function) ObjectFactory.newInstance(className, true);

  }
  catch (ConfigurationError e)
  {
    throw new TransformerException(e.getException());
  }
}