Top Description Inners Fields Constructors Methods
org.eclipse.persistence.internal.mappings.converters

public Class AttributeNameTokenizer

extends Object
implements Iterable<String>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.util.Iterator, .NoSuchElementException, java.util.regex.Matcher, .Pattern

INTERNAL: Attribute name tokenizer.
Author
Tomas Kraus

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AttributeNameTokenizer.TokensIterator

INTERNAL: Attribute name tokenizer parser implemented as an Iterator<String> over individual attribute name tokens.

Field Summary

Modifier and TypeField and Description
private final String
attributeName

Attribute name to be parsed.

private static final Pattern
KEY_DOT_PATTERN

Regular expression matching "key." substring.

private static final String
PREFIX

Regular expression capturing group name for attribute name prefix.

public static final char
SEPARATOR

INTERNAL: Attribute name dot notation separator.

private static final Pattern
VALUE_DOT_PATTERN

Regular expression matching "value." substring.

Constructor Summary

AccessConstructor and Description
public
AttributeNameTokenizer(final String attributeName)

INTERNAL: Creates an instance of attribute name tokenizer.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

Attribute name without key. prefix or null when no prefix was found.
getNameAfterKey
(final String
Attribute name containing key. prefix.
attributeName
)

INTERNAL: Return an attribute name without key.

public static String

Returns:

Attribute name without value. prefix or null when no prefix was found.
getNameAfterVersion
(final String
Attribute name containing value. prefix.
attributeName
)

INTERNAL: Return an attribute name without value.

public Iterator<String>

Returns:

An Iterator<String> over attribute name tokens.
iterator
()

Implements java.lang.Iterable.iterator.

INTERNAL: Returns an Iterator<String> over attribute name tokens.
public AttributeNameTokenizer.TokensIterator

Returns:

An TokensIterator over attribute name tokens.
tokensIterator
()

INTERNAL: Returns an TokensIterator over attribute name tokens.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeNameback to summary
private final String attributeName

Attribute name to be parsed.

KEY_DOT_PATTERNback to summary
private static final Pattern KEY_DOT_PATTERN

Regular expression matching "key." substring.

PREFIXback to summary
private static final String PREFIX

Regular expression capturing group name for attribute name prefix.

SEPARATORback to summary
public static final char SEPARATOR

INTERNAL: Attribute name dot notation separator.

VALUE_DOT_PATTERNback to summary
private static final Pattern VALUE_DOT_PATTERN

Regular expression matching "value." substring.

Constructor Detail

AttributeNameTokenizerback to summary
public AttributeNameTokenizer(final String attributeName)

INTERNAL: Creates an instance of attribute name tokenizer.

Method Detail

getNameAfterKeyback to summary
public static String getNameAfterKey(final String attributeName)

INTERNAL: Return an attribute name without key. dot notation prefix.

Parameters
attributeName:String

Attribute name containing key. prefix.

Returns:String

Attribute name without key. prefix or null when no prefix was found.

getNameAfterVersionback to summary
public static String getNameAfterVersion(final String attributeName)

INTERNAL: Return an attribute name without value. dot notation prefix.

Parameters
attributeName:String

Attribute name containing value. prefix.

Returns:String

Attribute name without value. prefix or null when no prefix was found.

iteratorback to summary
public Iterator<String> iterator()

Implements java.lang.Iterable.iterator.

INTERNAL: Returns an Iterator<String> over attribute name tokens.

Returns:Iterator<String>

An Iterator<String> over attribute name tokens.

Annotations
@Override
tokensIteratorback to summary
public AttributeNameTokenizer.TokensIterator tokensIterator()

INTERNAL: Returns an TokensIterator over attribute name tokens.

Returns:AttributeNameTokenizer.TokensIterator

An TokensIterator over attribute name tokens.

org.eclipse.persistence.internal.mappings.converters back to summary

public final Class AttributeNameTokenizer.TokensIterator

extends Object
implements Iterator<String>
Class Inheritance
  • java.lang.Object
  • org.eclipse.persistence.internal.mappings.converters.AttributeNameTokenizer.TokensIterator
All Implemented Interfaces
java.util.Iterator

INTERNAL: Attribute name tokenizer parser implemented as an Iterator<String> over individual attribute name tokens.

Field Summary

Modifier and TypeField and Description
private final Matcher
matcher

Regular expression matching engine.

private static final Pattern
NEXT_PATTERN

Regular expression used to parse attribute name and extract tokens from it.

private final AttributeNamePrefix
prefix

Prefix found in attribute name.

private static final Pattern
PREFIX_PATTERN

Regular expression used to parse attribute name and extract prefix and tokens from it.

private static final Pattern
SIMPLE_PATTERN

Regular expression used to parse attribute name and extract tokens from it.

private String
token

Next token to be returned.

Constructor Summary

AccessConstructor and Description
public
TokensIterator(final String
Attribute name to be parsed.
attributeName
)

INTERNAL: Creates an instance of attribute name tokenizer iterator.

public
TokensIterator(final String
Attribute name to be parsed.
attributeName
,
boolean
Do search for attribute name prefixes ("key." and "value.")?
isPrefix
)

INTERNAL: Creates an instance of attribute name tokenizer iterator.

Method Summary

Modifier and TypeMethod and Description
public AttributeNamePrefix

Returns:

Attribute name prefix.
getPrefix
()

INTERNAL: Get attribute name prefix.

public boolean

Returns:

Value of true if the iteration has more elements or false otherwise.
hasNext
()

Implements java.util.Iterator.hasNext.

INTERNAL: Returns true if the iteration has more elements.
public String

Returns:

The next attribute name token.
next
()

Implements java.util.Iterator.next.

INTERNAL: Return the next attribute name token from attribute name.
public void
remove()

Overrides default java.util.Iterator.remove.

INTERNAL: Removal of attribute name tokens makes no sense.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

matcherback to summary
private final Matcher matcher

Regular expression matching engine.

NEXT_PATTERNback to summary
private static final Pattern NEXT_PATTERN

Regular expression used to parse attribute name and extract tokens from it. There is just one capturing group:

  • name token to extract individual attribute name tokens
prefixback to summary
private final AttributeNamePrefix prefix

Prefix found in attribute name.

PREFIX_PATTERNback to summary
private static final Pattern PREFIX_PATTERN

Regular expression used to parse attribute name and extract prefix and tokens from it. There are two basic capturing groups:

  • prefix to extract attribute name prefix ("key" or "value")
  • name token to extract individual attribute name tokens
SIMPLE_PATTERNback to summary
private static final Pattern SIMPLE_PATTERN

Regular expression used to parse attribute name and extract tokens from it. There is just one capturing group:

  • name token to extract individual attribute name tokens
tokenback to summary
private String token

Next token to be returned.

Constructor Detail

TokensIteratorback to summary
public TokensIterator(final String attributeName)

INTERNAL: Creates an instance of attribute name tokenizer iterator. Simple parser without prefix parsing will be used so ("key." and "value.") will be returned as regular attribute name tokens.

Parameters
attributeName:String

Attribute name to be parsed.

TokensIteratorback to summary
public TokensIterator(final String attributeName, boolean isPrefix)

INTERNAL: Creates an instance of attribute name tokenizer iterator.

Parameters
attributeName:String

Attribute name to be parsed.

isPrefix:boolean

Do search for attribute name prefixes ("key." and "value.")?

Method Detail

getPrefixback to summary
public AttributeNamePrefix getPrefix()

INTERNAL: Get attribute name prefix.

Returns:AttributeNamePrefix

Attribute name prefix.

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

INTERNAL: Returns true if the iteration has more elements. In other words, returns true if next() would return an element rather than throwing an exception.

Returns:boolean

Value of true if the iteration has more elements or false otherwise.

Annotations
@Override
nextback to summary
public String next()

Implements java.util.Iterator.next.

INTERNAL: Return the next attribute name token from attribute name.

Returns:String

The next attribute name token.

Annotations
@Override
Exceptions
NoSuchElementException:
when attribute name has no more tokens.
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

INTERNAL: Removal of attribute name tokens makes no sense.

Annotations
@Override
Exceptions
UnsupportedOperationException:
is always thrown on invocation.