# Class AbstractRef

java.lang.Object
javax.naming.Reference
org.apache.naming.AbstractRef

All Implemented Interfaces:
  `Serializable, Cloneable`

Direct Known Subclasses:
  `EjbRef, HandlerRef, LookupRef, ResourceEnvRef, ResourceLinkRef, ResourceRef, ServiceRef, TransactionRef`

public abstract class AbstractRef extends Reference
Abstract base class for `Reference` implementations used by the naming context. Provides a default factory class name lookup mechanism.

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class Reference

`addrs, classFactory, classFactoryLocation, className`

## Constructor Summary

Constructors
Constructor
Description
`AbstractRef(String className)`
Constructs a new `AbstractRef` with the specified class name.
`AbstractRef(String className, String factory, String factoryLocation)`
Constructs a new `AbstractRef` with the specified class name, factory class name, and factory location.

## Method Summary

Modifier and Type
Method
Description
`protected abstract String`
`getDefaultFactoryClassName()`
Returns the default factory class name.
`final String`
`getFactoryClassName()`
`final String`
`toString()`

### Methods inherited from class Reference

`add, add, clear, clone, equals, get, get, getAll, getClassName, getFactoryClassLocation, hashCode, remove, size`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AbstractRef

public AbstractRef(String className)
Constructs a new `AbstractRef` with the specified class name.

Parameters:
  `className` - The non-null class name

### AbstractRef

public AbstractRef(String className, String factory, String factoryLocation)
Constructs a new `AbstractRef` with the specified class name, factory class name, and factory location.

Parameters:
  `className` - The non-null class name
  `factory` - The factory class name
  `factoryLocation` - The factory location

## Method Details

### getFactoryClassName

public final String getFactoryClassName()

Overrides:
  `getFactoryClassName` in class `Reference`

### getDefaultFactoryClassName

protected abstract String getDefaultFactoryClassName()
Returns the default factory class name.

Returns:
  the default factory class name

### toString

public final String toString()

Overrides:
  `toString` in class `Reference`