public final class ReservedWordSymbolProvider extends java.lang.Object implements SymbolProvider
SymbolProvider by passing values through context
specific ReservedWords implementations.
A specific ReservedWords implementation can be registered
for each kind of symbol provided by the delegated SymbolProvider.
For example, reserved words can be created that are specific to
class names.
This motivation behind this class is to allow more general purpose
implementations of SymbolProvider and ReservedWords to
be composed.
A warning is logged each time a symbol is renamed by a reserved words implementation.
SymbolProvider implementations that need to recursively call themselves
in a way that requires recursive symbols to be escaped will need to
manually make calls into ReservedWordSymbolProvider.Escaper and
cannot be decorated by an instance of ReservedWordSymbolProvider.
For example, this is the case if a list of strings needs to be turned
into something like "Array[%s]" where "%s" is the symbol name of the
targeted member.
| Modifier and Type | Class and Description |
|---|---|
static class |
ReservedWordSymbolProvider.Builder
Builder to build a
ReservedWordSymbolProvider. |
static class |
ReservedWordSymbolProvider.Escaper
Uses to manually escape
Symbols and member names. |
| Modifier and Type | Method and Description |
|---|---|
static ReservedWordSymbolProvider.Builder |
builder()
Builder to create a ReservedWordSymbolProvider instance.
|
java.lang.String |
toMemberName(MemberShape shape)
Converts a member shape to a member/property name of a containing
data structure.
|
Symbol |
toSymbol(Shape shape)
Gets the symbol to define for the given shape.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcachepublic static ReservedWordSymbolProvider.Builder builder()
public Symbol toSymbol(Shape shape)
SymbolProviderA "symbol" represents the qualified name of a type in a target programming language.
toSymbol in interface SymbolProvidershape - Shape to get the class name of.public java.lang.String toMemberName(MemberShape shape)
SymbolProviderThe default implementation will return the member name of the provided shape ID and should be overridden if necessary.
toMemberName in interface SymbolProvidershape - Shape to convert.