Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.serialize
Class SerializerFactory

    java.lang.Object
      |
      +--org.apache.serialize.SerializerFactory

public abstract class SerializerFactory
extends java.lang.Object

Factory for creating default serializers. An implementation need only support the default output methods (XML, HTML and Text). Additional serializers may be constructed directly by the application.

The factory is used with the default serializers provided by the implementation and named in the `serializer.properties` file of the implementation.

Usage example:

     Serializer ser;

     ser = SerializerFactory.getSerializer( Method.XML );

or,

     Serializer   ser;
     OutputFormat format;

     format = SerializerFactory.getOutputFormat( Method.HTML );
     ser = SerializerFactory.getSerializer( format );

Field Summary
`static java.lang.String` | `PropertiesResource` The name of the properties file listing all the supported serializers.
`static java.lang.String` | `PropertyFormatPrefix` The prefix of a property supplying the class name for an output format implementing a specific method.
`static java.lang.String` | `PropertyMethods` The name of the property listing all the supported output methods.
`static java.lang.String` | `PropertySerializerPrefix` The prefix of a property supplying the class name for a serializer implementing a specific method.

Constructor Summary
`SerializerFactory()`

Method Summary
`static OutputFormat` | `getOutputFormat(java.lang.String method)` Returns an output format for the specified output method.
`static Serializer` | `getSerializer(OutputFormat format)` Returns a serializer for the specified output method.
`static Serializer` | `getSerializer(java.lang.String method)` Returns a serializer for the specified output method.
`java.util.Enumeration` | `listMethods()` Returns an enumeration of all the output methods supported by this implementation.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PropertiesResource

    public static final java.lang.String PropertiesResource

  The name of the properties file listing all the supported serializers. (`/org/xml/serilize/serializer.properties`).

### PropertyMethods

    public static final java.lang.String PropertyMethods

  The name of the property listing all the supported output methods. Contains a comma delimited list of method names. (`serialize.methods`).

### PropertySerializerPrefix

    public static final java.lang.String PropertySerializerPrefix

  The prefix of a property supplying the class name for a serializer implementing a specific method. (`serialize.`).

### PropertyFormatPrefix

    public static final java.lang.String PropertyFormatPrefix

  The prefix of a property supplying the class name for an output format implementing a specific method. (`serialize.format.`).

Constructor Detail

### SerializerFactory

    public SerializerFactory()

Method Detail

### getSerializer

    public static Serializer getSerializer(java.lang.String method)

  Returns a serializer for the specified output method. Returns null if no implementation exists that supports the specified output method. For a list of the default output methods see `Method`.
  Parameters:
    `method` - The output method
  Returns:
    A suitable serializer, or null

### getSerializer

    public static Serializer getSerializer(OutputFormat format)

  Returns a serializer for the specified output method. Returns null if no implementation exists that supports the specified output method. For a list of the default output methods see `Method`.
  Parameters:
    `format` - The output format
  Returns:
    A suitable serializer, or null

### getOutputFormat

    public static OutputFormat getOutputFormat(java.lang.String method)

  Returns an output format for the specified output method. An implementation may extend `OutputFormat` to provide additional properties.
  Parameters:
    `method` - The output method
  Returns:
    A suitable output format

### listMethods

    public java.util.Enumeration listMethods()

  Returns an enumeration of all the output methods supported by this implementation. The enumeration contains the names of all the output methods for which this implementation provides a serializer.
  Returns:
    An enumeration of all output methods

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache XML Project. All Rights Reserved.