|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.ecore.util.EcoreValidator.EGenericTypeBuilder
public static class EcoreValidator.EGenericTypeBuilder
A utility for parsing generic types and generic type parameters.
Field Summary | |
---|---|
static EcoreValidator.EGenericTypeBuilder |
INSTANCE
A singleton instance of the generic type build. |
Constructor Summary | |
---|---|
EcoreValidator.EGenericTypeBuilder()
|
Method Summary | |
---|---|
protected BasicDiagnostic |
createDiagnostic(int severity,
java.lang.String source,
int code,
java.lang.String messageKey,
java.lang.Object[] messageSubstitutions,
java.lang.Object[] data)
Creates a new basic diagnostic . |
protected ResourceLocator |
getResourceLocator()
Returns the resource locator for fetching messages. |
protected java.lang.String |
getString(java.lang.String key,
java.lang.Object[] substitutions)
Returns a translated message with the given substitutions. |
protected EGenericType |
handleInstanceTypeName(char[] instanceTypeName,
int start,
int end,
DiagnosticChain diagnostics)
A well formed instance type name must syntactically denote a valid Java type name; names denoting keywords are considered well formed. |
protected EGenericType |
handleTypeArgument(char[] instanceTypeName,
int start,
int end,
DiagnosticChain diagnostics)
A well formed type argument must denote a valid Java type argument. |
protected java.util.List<EGenericType> |
handleTypeArguments(char[] instanceTypeName,
int start,
int end,
DiagnosticChain diagnostics)
Well formed type arguments must syntactically denote a comma separated sequence of well formed type arguments . |
protected ETypeParameter |
handleTypeParameter(char[] typeParameters,
int start,
int end,
DiagnosticChain diagnostics)
A well formed type parameter must denote a valid Java type parameter. |
protected java.util.List<ETypeParameter> |
handleTypeParameters(char[] typeParameters,
int start,
int end,
DiagnosticChain diagnostics)
Well formed type parameters must syntactically denote a comma separated sequence of well formed type parameters delimited by "<>". |
protected boolean |
isIdentifierPart(int codePoint)
Returns whether this code point is a valid part of an identifier, i.e., whether it's valid after the first character. |
protected boolean |
isIdentifierStart(int codePoint)
Returns whether this code point is a valid start of an identifier. |
Diagnostic |
parseInstanceTypeName(java.lang.String instanceTypeName)
Parses an instance type name and returns a diagnostic representing the result of the analysis. |
Diagnostic |
parseTypeArgumentList(java.lang.String typeArgumentList)
Parses a list of type arguments and returns a diagnostic representing the result of the analysis. |
Diagnostic |
parseTypeParameter(java.lang.String typeParameter)
Parses a type parameter and returns a diagnostic representing the result of the analysis. |
Diagnostic |
parseTypeParameterList(java.lang.String typeParameterList)
Parses a list of type parameters and returns a diagnostic representing the result of the analysis. |
protected void |
report(DiagnosticChain diagnostics,
java.lang.String message,
int index)
Creates a new diagnostic for a problem at the given index. |
protected void |
report(DiagnosticChain diagnostics,
java.lang.String key,
java.lang.Object[] substitutions,
int index)
Creates a new diagnostic for a problem at the given index. |
protected EClassifier |
resolveEClassifier(java.lang.String instanceTypeName)
Finds or creates an classifier with the given instance type name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final EcoreValidator.EGenericTypeBuilder INSTANCE
Constructor Detail |
---|
public EcoreValidator.EGenericTypeBuilder()
Method Detail |
---|
public Diagnostic parseInstanceTypeName(java.lang.String instanceTypeName)
data
of the diagnostic will contain as the first object, the resulting generic type
.
instanceTypeName
- an instance type name.
public Diagnostic parseTypeParameterList(java.lang.String typeParameterList)
data
of the diagnostic will contain as the first object, the resulting list of type parameters
.
typeParameterList
- a comma separated list of type parameters delimited by '<' and '>'.
public Diagnostic parseTypeArgumentList(java.lang.String typeArgumentList)
data
of the diagnostic will contain as the first object, the resulting list of type arguments
.
typeArgumentList
- a comma separated list of type arguments.
public Diagnostic parseTypeParameter(java.lang.String typeParameter)
data
of the diagnostic will contain as the first object, the resulting type parameter
.
typeParameter
- comma separated list of type parameters delimited by '<' and '>'.
protected EClassifier resolveEClassifier(java.lang.String instanceTypeName)
classifier
with the given instance type name.
instanceTypeName
- the instance type name for which a classifier is needed.
protected void report(DiagnosticChain diagnostics, java.lang.String key, java.lang.Object[] substitutions, int index)
diagnostics
- the target for the new diagnostic.key
- the key for the message.substitutions
- the substitutions for the key; null
if there are no substitutions.index
- the index at which the problem occurred.protected void report(DiagnosticChain diagnostics, java.lang.String message, int index)
diagnostics
- the target for the new diagnostic.message
- the text describing the problem.index
- the index at which the problem occurred.protected EGenericType handleInstanceTypeName(char[] instanceTypeName, int start, int end, DiagnosticChain diagnostics)
Java identifier start character
,
that is followed by zero or more Java identifier part characters
.
The methods isIdentifierStart(int)
and isIdentifierPart(int)
are used so that this behavior can be specialized.
This qualified name may optionally be followed by zero or more pairs of "[]" characters
or by type arguments consisting of the pair of "<>" characters
with embedded well formed type arguments
.
instanceTypeName
- the instance type name in question.start
- the start of the characters under consideration.end
- the end of the characters under consideration.diagnostics
- the target in which to accumulate diagnostics.
protected boolean isIdentifierStart(int codePoint)
codePoint
- the code point in question.
protected boolean isIdentifierPart(int codePoint)
codePoint
- the code point in question.
protected java.util.List<EGenericType> handleTypeArguments(char[] instanceTypeName, int start, int end, DiagnosticChain diagnostics)
well formed type arguments
.
Whitespace before or after arguments is ignored.
instanceTypeName
- the instance type name in question.start
- the start of the characters under consideration.end
- the end of the characters under consideration.diagnostics
- the target in which to accumulate diagnostics.
protected EGenericType handleTypeArgument(char[] instanceTypeName, int start, int end, DiagnosticChain diagnostics)
well formed type instance name
.
White space before the keyword is optional but at least one space character is expected after the keyword.
Otherwise, the whole string must be a well formed instance type name.
instanceTypeName
- the instance type name in question.start
- the start of the characters under consideration.end
- the end of the characters under consideration.diagnostics
- the target in which to accumulate diagnostics.
protected java.util.List<ETypeParameter> handleTypeParameters(char[] typeParameters, int start, int end, DiagnosticChain diagnostics)
well formed type parameters
delimited by "<>".
Whitespace before or after parameters is ignored.
typeParameters
- the type parameters question.start
- the start of the characters under consideration.end
- the end of the characters under consideration.diagnostics
- the target in which to accumulate diagnostics.
protected ETypeParameter handleTypeParameter(char[] typeParameters, int start, int end, DiagnosticChain diagnostics)
well formed type arguments
representing the bounds.
White space before the keyword is optional but at least one space character is expected after the keyword.
typeParameters
- the instance type name in question.start
- the start of the characters under consideration.end
- the end of the characters under consideration.diagnostics
- the target in which to accumulate diagnostics.
protected BasicDiagnostic createDiagnostic(int severity, java.lang.String source, int code, java.lang.String messageKey, java.lang.Object[] messageSubstitutions, java.lang.Object[] data)
basic diagnostic
.
It calls getString(String, Object[])
for the message substitution.
severity
- an indicator of the severity of the problem.source
- the unique identifier of the source.code
- the source-specific identity code.messageKey
- the key of the message.messageSubstitutions
- the substitutions for the key; null
if there are no substitutions.data
- the data associated with the diagnostic
BasicDiagnostic.BasicDiagnostic(int, String, int, String, Object[])
protected java.lang.String getString(java.lang.String key, java.lang.Object[] substitutions)
resource locator
is used.
key
- the key for the message.substitutions
- the substitutions for the key; null
if there are no substitutions.
protected ResourceLocator getResourceLocator()
fetching
messages.
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |