GenericNamingResourcesFactory (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.tomcat.jdbc.naming, class: GenericNamingResourcesFactory

# Class GenericNamingResourcesFactory

java.lang.Object
org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory

All Implemented Interfaces:
  `ObjectFactory`

public class GenericNamingResourcesFactory extends Object implements ObjectFactory
Simple way of configuring generic resources by using reflection. Example usage:

    <Resource factory="org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory"
                 name="jdbc/test"
                 type="org.apache.derby.jdbc.ClientXADataSource"
                 databaseName="sample"
                 createDatabase="create"
                 serverName="localhost"
                 port="1527"/>

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericNamingResourcesFactory()`
  Creates a new GenericNamingResourcesFactory instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `capitalize(String name)`
  Capitalizes the first character of the given string.
  `Object`
  `getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GenericNamingResourcesFactory

    public GenericNamingResourcesFactory()
    Creates a new GenericNamingResourcesFactory instance.

- ## Method Details

  - ### getObjectInstance

    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
    Specified by:
      `getObjectInstance` in interface `ObjectFactory`
    Throws:
      `Exception`

  - ### capitalize

    public static String capitalize(String name)
    Capitalizes the first character of the given string.
    Parameters:
      `name` - The string to capitalize
    Returns:
      The capitalized string, or the original if null or empty