uk.apl.jxc.mapper
Class XMLMappingFileIterator

java.lang.Object
  extended by uk.apl.jxc.mapper.XMLMappingFileIterator
All Implemented Interfaces:
java.util.Iterator

public class XMLMappingFileIterator
extends java.lang.Object
implements java.util.Iterator

Provides mappings read from a .properties file. The properties file should contain five key/value pairs per mapping in the following format:

KeyValue
MAPPING[sequence].SOURCEvalue of sourcePath
MAPPING[sequence].TARGETvalue of targetPath
MAPPING[sequence].CONDITIONvalue of condition
MAPPING[sequence].FUNCTIONvalue of function
MAPPING[sequence].DEFAULTvalue of defaultValue

Author:
Andrew Leigh
See Also:
AbstractXMLMapping, XMLControl, XMLDefault, XMLMapping

Field Summary
static java.lang.String CONDITION
           
static java.lang.String DEFAULT
           
static java.lang.String FUNCTION
           
static java.lang.String MAPPING
           
static java.lang.String SOURCE
           
static java.lang.String TARGET
           
 
Constructor Summary
XMLMappingFileIterator(java.io.File savedMapping)
          Constructs a new XMLMappingFileIterator.
 
Method Summary
 boolean hasNext()
          Determines whether or not more mappings are available.
 AbstractXMLMapping next()
          Returns the next XML mapping in the configuration.
 void remove()
          Not currently implemented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAPPING

public static final java.lang.String MAPPING
See Also:
Constant Field Values

SOURCE

public static final java.lang.String SOURCE
See Also:
Constant Field Values

TARGET

public static final java.lang.String TARGET
See Also:
Constant Field Values

CONDITION

public static final java.lang.String CONDITION
See Also:
Constant Field Values

FUNCTION

public static final java.lang.String FUNCTION
See Also:
Constant Field Values

DEFAULT

public static final java.lang.String DEFAULT
See Also:
Constant Field Values
Constructor Detail

XMLMappingFileIterator

public XMLMappingFileIterator(java.io.File savedMapping)
                       throws java.io.FileNotFoundException,
                              java.io.IOException
Constructs a new XMLMappingFileIterator.

Parameters:
savedMapping - a file containing a saved XMLMapper configuration
Throws:
java.io.FileNotFoundException - if the file cannot be found
java.io.IOException - if an error occurs reading the file
InvalidMappingException - if the mappings found within the file are invalid
Method Detail

next

public AbstractXMLMapping next()
Returns the next XML mapping in the configuration.

Specified by:
next in interface java.util.Iterator
Returns:
the next XML mapping

hasNext

public boolean hasNext()
Determines whether or not more mappings are available.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if more mappings are available, false otherwise

remove

public void remove()
Not currently implemented.

Specified by:
remove in interface java.util.Iterator


Copyright 2010 Andrew Leigh. All Rights Reserved.