org.apache.jdo.impl.model.jdo
Class JDOModelImplDynamic.MetadataResourceNameIterator
java.lang.Object
org.apache.jdo.impl.model.jdo.JDOModelImplDynamic.MetadataResourceNameIterator
- All Implemented Interfaces:
- java.util.Iterator
- Enclosing class:
- JDOModelImplDynamic
- private static class JDOModelImplDynamic.MetadataResourceNameIterator
- extends java.lang.Object
- implements java.util.Iterator
This Iterator implementation iterates resource names of possible JDO
metadata files for the specified class name. Chapter 18 of the JDO
specification defines the search order as follows:
META-INF/package.jdo, WEB-INF/package.jdo, package.jdo,
/...//package.jdo, and /.jdo.
Field Summary |
private static java.lang.String[] |
constantResources
List of constant package JDO metadata file names. |
private int |
constantResourcesIndex
Current index in the list of constant package JDO metadata file names. |
private int |
fromIndex
Current index in the prefix. |
private boolean |
hasNext
Indicates whether this iterator has more elements. |
private static java.lang.String |
JDO_SUFFIX
Suffix of a JDO metadata file. |
private static java.lang.String |
PACKAGE_JDO
The name of a package JDO metadata file. |
private java.lang.String |
prefix
The class name as resource name. |
Method Summary |
boolean |
hasNext()
Returns true if the iteration has more elements. |
java.lang.Object |
next()
Returns the next resource name. |
void |
remove()
This Iterator does not implement this method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDO_SUFFIX
private static final java.lang.String JDO_SUFFIX
- Suffix of a JDO metadata file.
- See Also:
- Constant Field Values
PACKAGE_JDO
private static final java.lang.String PACKAGE_JDO
- The name of a package JDO metadata file.
- See Also:
- Constant Field Values
constantResources
private static final java.lang.String[] constantResources
- List of constant package JDO metadata file names.
hasNext
private boolean hasNext
- Indicates whether this iterator has more elements.
prefix
private final java.lang.String prefix
- The class name as resource name.
constantResourcesIndex
private int constantResourcesIndex
- Current index in the list of constant package JDO metadata file names.
fromIndex
private int fromIndex
- Current index in the prefix.
JDOModelImplDynamic.MetadataResourceNameIterator
public JDOModelImplDynamic.MetadataResourceNameIterator(java.lang.String className)
- Constructor.
hasNext
public boolean hasNext()
- Returns
true
if the iteration has more elements.
- Specified by:
hasNext
in interface java.util.Iterator
- Returns:
true
if the iterator has more elements.
next
public java.lang.Object next()
- Returns the next resource name.
- Specified by:
next
in interface java.util.Iterator
- Returns:
- the next resource name.
- Throws:
java.util.NoSuchElementException
- iteration has no more elements.
remove
public void remove()
- This Iterator does not implement this method.
- Specified by:
remove
in interface java.util.Iterator
- Throws:
java.lang.UnsupportedOperationException
- if the
remove
operation is not supported by this
Iterator.