public static class EcoreValidator.EGenericTypeBuilder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static EcoreValidator.EGenericTypeBuilder |
INSTANCE
A singleton instance of the generic type build.
|
| Constructor and Description |
|---|
EGenericTypeBuilder() |
| Modifier and Type | Method and Description |
|---|---|
EGenericType |
buildEGenericType(java.lang.String instanceTypeName)
Parses an instance type name and returns its representation as an
generic type. |
java.util.List<EGenericType> |
buildEGenericTypes(java.lang.String typeArgumentList)
Parses a list of type arguments and returns its representation as a list of
type arguments. |
ETypeParameter |
buildETypeParameter(java.lang.String typeParameter)
Parses a type parameter and returns its representation as
type parameter. |
java.util.List<ETypeParameter> |
buildETypeParameters(java.lang.String typeParameterList)
Parses a list of type parameters and returns its representation as a list of
type parameters. |
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. |
public static final EcoreValidator.EGenericTypeBuilder INSTANCE
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 EGenericType buildEGenericType(java.lang.String instanceTypeName)
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 java.util.List<ETypeParameter> buildETypeParameters(java.lang.String typeParameterList)
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 java.util.List<EGenericType> buildEGenericTypes(java.lang.String typeArgumentList)
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 - a type parameter.public ETypeParameter buildETypeParameter(java.lang.String typeParameter)
type parameter.typeParameter - a type parameter.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 diagnosticBasicDiagnostic#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 © 2018. Licensed under the Eclipse Public License v1.0. All rights reserved.
Submit a bug or feature