public class DefaultConfigurationKey.KeyIterator
extends java.lang.Object
implements java.util.Iterator, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
private boolean |
attribute
Stores a flag if the actual property is an attribute.
|
private java.lang.String |
current
Stores the current key name.
|
private int |
endIndex
Stores the end index of the actual token.
|
private boolean |
hasIndex
Stores a flag if the actual property has an index.
|
private int |
indexValue
Stores the index of the actual property if there is one.
|
private int |
startIndex
Stores the start index of the actual token.
|
Constructor and Description |
---|
DefaultConfigurationKey.KeyIterator() |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkAttribute(java.lang.String key)
Helper method for checking if the passed key is an attribute.
|
private boolean |
checkIndex(java.lang.String key)
Helper method for checking if the passed key contains an index.
|
java.lang.Object |
clone()
Creates a clone of this object.
|
java.lang.String |
currentKey()
Returns the current key of the iteration (without skipping to the
next element).
|
java.lang.String |
currentKey(boolean decorated)
Returns the current key of the iteration (without skipping to the
next element).
|
private int |
escapedPosition(java.lang.String key,
int pos)
Checks if a delimiter at the specified position is escaped.
|
private int |
escapeOffset()
Determines the relative offset of an escaped delimiter in relation to
a delimiter.
|
private java.lang.String |
findNextIndices()
Helper method for determining the next indices.
|
int |
getIndex()
Returns the index value of the current key.
|
boolean |
hasIndex()
Returns a flag if the current key has an associated index.
|
boolean |
hasNext()
Checks if there is a next element.
|
boolean |
isAttribute()
Returns a flag if the current key is an attribute.
|
private boolean |
isAttributeEmulatingMode()
Returns a flag whether attributes are marked the same way as normal
property keys.
|
boolean |
isPropertyKey()
Returns a flag whether the current key refers to a property (i.e.
|
java.lang.Object |
next()
Returns the next object in the iteration.
|
private int |
nextDelimiterPos(java.lang.String key,
int pos,
int endPos)
Searches the next unescaped delimiter from the given position.
|
java.lang.String |
nextKey()
Returns the next key part of this configuration key.
|
java.lang.String |
nextKey(boolean decorated)
Returns the next key part of this configuration key.
|
private java.lang.String |
nextKeyPart()
Helper method for extracting the next key part.
|
void |
remove()
Removes the current object in the iteration.
|
private java.lang.String current
private int startIndex
private int endIndex
private int indexValue
private boolean hasIndex
private boolean attribute
public java.lang.String nextKey()
nextKey(false)
.public java.lang.String nextKey(boolean decorated)
decorated
- a flag if the decorated key is to be returnedpublic boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
public java.lang.String currentKey()
next()
call had returned. (Short form of currentKey(false)
.public java.lang.String currentKey(boolean decorated)
decorated
- a flag if the decorated key is to be returnedpublic boolean isAttribute()
next()
.public boolean isPropertyKey()
isAttribute()
, but if the delimiters for
normal properties and attributes are set to the same string, it is
possible that both methods return true.isAttribute()
public int getIndex()
next()
.public boolean hasIndex()
next()
.public java.lang.Object clone()
clone
in class java.lang.Object
private java.lang.String findNextIndices()
private java.lang.String nextKeyPart()
private int nextDelimiterPos(java.lang.String key, int pos, int endPos)
key
- the keypos
- the start positionendPos
- the end positionprivate int escapedPosition(java.lang.String key, int pos)
key
- the key to checkpos
- the position where a delimiter was foundprivate int escapeOffset()
private boolean checkAttribute(java.lang.String key)
key
- the key to be checkedprivate boolean checkIndex(java.lang.String key)
key
- the key to be checkedprivate boolean isAttributeEmulatingMode()