org.marc4j.marc
Class MarcFactory

java.lang.Object
  extended by org.marc4j.marc.MarcFactory
Direct Known Subclasses:
MarcFactoryImpl

public abstract class MarcFactory
extends Object

Factory for creating MARC record objects.

You can use MarcFactory to create records from scratch:

 
  MarcFactory factory = MarcFactory.newInstance();
  Record record = factory.newRecord();
  ControlField cf = factory.newControlField("001");
  record.addVariableField(cf);
  etc...
  
 

Version:
$Revision: 1.2 $
Author:
Bas Peters

Constructor Summary
protected MarcFactory()
           
 
Method Summary
abstract  ControlField newControlField()
          Returns a new control field instance.
abstract  ControlField newControlField(String tag)
          Creates a new control field with the given tag and returns the instance.
abstract  ControlField newControlField(String tag, String data)
          Creates a new control field with the given tag and data and returns the instance.
abstract  DataField newDataField()
          Returns a new data field instance.
abstract  DataField newDataField(String tag, char ind1, char ind2)
          Creates a new data field with the given tag and indicators and returns the instance.
static MarcFactory newInstance()
          Creates a new factory instance.
abstract  Leader newLeader()
          Returns a new leader instance.
abstract  Leader newLeader(String ldr)
          Creates a new leader with the given String object.
abstract  Record newRecord()
          Returns a new record instance.
abstract  Record newRecord(Leader leader)
          Returns a new record instance.
abstract  Record newRecord(String leader)
          Returns a new record instance.
abstract  Subfield newSubfield()
          Returns a new subfield instance.
abstract  Subfield newSubfield(char code)
          Creates a new subfield with the given identifier.
abstract  Subfield newSubfield(char code, String data)
          Creates a new subfield with the given identifier and data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarcFactory

protected MarcFactory()
Method Detail

newInstance

public static MarcFactory newInstance()
Creates a new factory instance. The implementation class to load is the first found in the following locations:
  1. the org.marc4j.marc.MarcFactory system property
  2. the above named property value in the $JAVA_HOME/lib/marc4j.properties file
  3. the class name specified in the META-INF/services/org.marc4j.marc.MarcFactory system resource
  4. the default factory class


newControlField

public abstract ControlField newControlField()
Returns a new control field instance.

Returns:
ControlField

newControlField

public abstract ControlField newControlField(String tag)
Creates a new control field with the given tag and returns the instance.

Returns:
ControlField

newControlField

public abstract ControlField newControlField(String tag,
                                             String data)
Creates a new control field with the given tag and data and returns the instance.

Returns:
ControlField

newDataField

public abstract DataField newDataField()
Returns a new data field instance.

Returns:
DataField

newDataField

public abstract DataField newDataField(String tag,
                                       char ind1,
                                       char ind2)
Creates a new data field with the given tag and indicators and returns the instance.

Returns:
DataField

newLeader

public abstract Leader newLeader()
Returns a new leader instance.

Returns:
Leader

newLeader

public abstract Leader newLeader(String ldr)
Creates a new leader with the given String object.

Returns:
Leader

newRecord

public abstract Record newRecord()
Returns a new record instance.

Returns:
Record

newRecord

public abstract Record newRecord(Leader leader)
Returns a new record instance.

Returns:
Record

newRecord

public abstract Record newRecord(String leader)
Returns a new record instance.

Returns:
Record

newSubfield

public abstract Subfield newSubfield()
Returns a new subfield instance.

Returns:
Leader

newSubfield

public abstract Subfield newSubfield(char code)
Creates a new subfield with the given identifier.

Returns:
Subfield

newSubfield

public abstract Subfield newSubfield(char code,
                                     String data)
Creates a new subfield with the given identifier and data.

Returns:
Subfield


Copyright © 2002-2006 Bas Peters. All Rights Reserved.