jpos.config.simple.xml
Class SimpleXmlRegPopulator

java.lang.Object
  |
  +--jpos.config.simple.AbstractRegPopulator
        |
        +--jpos.config.simple.xml.SimpleXmlRegPopulator
All Implemented Interfaces:
JposRegPopulator, XmlRegPopulator

public class SimpleXmlRegPopulator
extends AbstractRegPopulator
implements XmlRegPopulator

Simple implementation of the JposRegPopulator that loads and saves the entries in XML using the "jpos/res/jcl.dtd" DTD and the XML4J (Xerces) API NOTE: this class must define a public no-argument ctor so that it may be created via reflection when its defined in the jpos.properties as the jpos.config.regPopulatorClass

Since:
1.2 (NY 2K meeting)
Author:
E. Michael Maximilien (maxim@us.ibm.com)
See Also:
JposPropertiesConst.JPOS_REG_POPULATOR_CLASS_PROP_NAME

Fields inherited from class jpos.config.simple.AbstractRegPopulator
lastLoadException
 
Fields inherited from interface jpos.config.simple.xml.XmlRegPopulator
DEFAULT_XML_FILE_NAME
 
Constructor Summary
SimpleXmlRegPopulator()
          Default ctor
SimpleXmlRegPopulator(java.lang.String s)
          1-arg constructor that takes the unique ID
 
Method Summary
 java.lang.String getClassName()
           
 java.util.Enumeration getEntries()
           
 java.net.URL getEntriesURL()
           
 java.lang.Exception getLastLoadException()
           
 java.lang.String getName()
           
 void load()
          Tell the populator to load the entries
 void load(java.lang.String fileName)
          Loads the entries specified in the fileName
 void save(java.util.Enumeration entries)
          Tell the populator to save the current entries
 void save(java.util.Enumeration entries, java.lang.String fileName)
          Tell the populator to save the current entries in the file specified
 
Methods inherited from class jpos.config.simple.AbstractRegPopulator
createURLFromFile, createURLFromFile, findFileInClasspath, findFileInJarZipFiles, getJposEntries, getPopulatorFileIS, getPopulatorFileName, getPopulatorFileOS, getPopulatorFileURL, getUniqueId, isComposite, isPopulatorFileDefined, setUniqueId, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jpos.config.JposRegPopulator
getUniqueId, isComposite
 

Constructor Detail

SimpleXmlRegPopulator

public SimpleXmlRegPopulator()
Default ctor
Since:
1.2 (NY 2K meeting)

SimpleXmlRegPopulator

public SimpleXmlRegPopulator(java.lang.String s)
1-arg constructor that takes the unique ID
Parameters:
s - the unique ID string
Since:
1.3 (Washington DC 2001)
Method Detail

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface JposRegPopulator
Returns:
the fully qualified class name implementing the JposRegPopulator interface
Since:
1.3 (Washington DC 2001 meeting)

save

public void save(java.util.Enumeration entries)
          throws java.lang.Exception
Tell the populator to save the current entries
Specified by:
save in interface JposRegPopulator
Overrides:
save in class AbstractRegPopulator
Parameters:
entries - an enumeration of JposEntry objects
Throws:
java.lang.Exception - if any error occurs while saving
Since:
1.2 (NY 2K meeting)

save

public void save(java.util.Enumeration entries,
                 java.lang.String fileName)
          throws java.lang.Exception
Tell the populator to save the current entries in the file specified
Specified by:
save in interface JposRegPopulator
Overrides:
save in class AbstractRegPopulator
Parameters:
entries - an enumeration of JposEntry objects
fileName - the file name to save entries
Throws:
java.lang.Exception - if any error occurs while saving
Since:
1.3 (SF 2K meeting)

load

public void load()
Tell the populator to load the entries
Specified by:
load in interface JposRegPopulator
Overrides:
load in class AbstractRegPopulator
Since:
1.2 (NY 2K meeting)

load

public void load(java.lang.String fileName)
Loads the entries specified in the fileName
Specified by:
load in interface JposRegPopulator
Overrides:
load in class AbstractRegPopulator
Parameters:
fileName - the entries file name
Since:
1.3 (SF 2K meeting)

getEntries

public java.util.Enumeration getEntries()
Specified by:
getEntries in interface JposRegPopulator
Overrides:
getEntries in class AbstractRegPopulator
Returns:
an Enumeration of JposEntry objects NOTE: need to overridde this method here because need to forward call to the regPopulator instance
Since:
1.2 (NY 2K meeting)

getEntriesURL

public java.net.URL getEntriesURL()
Specified by:
getEntriesURL in interface JposRegPopulator
Overrides:
getEntriesURL in class AbstractRegPopulator
Returns:
the URL pointing to the entries file loaded or saved
Since:
1.2 (NY 2K meeting)

getName

public java.lang.String getName()
Specified by:
getName in interface JposRegPopulator
Overrides:
getName in class AbstractRegPopulator
Returns:
the name of this populator. This should be a short descriptive name
Since:
1.3 (Washington DC 2001 meeting)

getLastLoadException

public java.lang.Exception getLastLoadException()
Specified by:
getLastLoadException in interface JposRegPopulator
Overrides:
getLastLoadException in class AbstractRegPopulator
Returns:
the last exception (if any) during the last load or null if no exception occurred
Since:
2.0.0


This API and code belongs to the JavaPOS committee please see LISCENCE file for details