Class TracingSymbolProvider
- java.lang.Object
-
- software.amazon.smithy.codegen.core.trace.TracingSymbolProvider
-
- All Implemented Interfaces:
SymbolProvider
public final class TracingSymbolProvider extends java.lang.Object implements SymbolProvider
Decorates aSymbolProvider
with aTraceFile.Builder
and adds aShapeLink
object to the builder on each call to toSymbol.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TracingSymbolProvider.Builder
Builder to create a TracingSymbolProvider instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TracingSymbolProvider.Builder
builder()
Builder to create a TracingSymbolProvider instance.TraceFile
buildTraceFile()
Builds and returns theTracingSymbolProvider
'sTraceFile.Builder
.java.lang.String
toMemberName(MemberShape shape)
Converts a member shape to a member/property name of a containing data structure.Symbol
toSymbol(Shape shape)
Converts a shape into a symbol by calling the toSymbol method of the SymbolProvider used to construct this TracingSymbolProvider.
-
-
-
Method Detail
-
builder
public static TracingSymbolProvider.Builder builder()
Builder to create a TracingSymbolProvider instance.- Returns:
- Returns a new Builder.
-
buildTraceFile
public TraceFile buildTraceFile()
Builds and returns theTracingSymbolProvider
'sTraceFile.Builder
.- Returns:
- The
TraceFile
built from thisTracingSymbolProvider
'sTraceFile.Builder
.
-
toSymbol
public Symbol toSymbol(Shape shape)
Converts a shape into a symbol by calling the toSymbol method of the SymbolProvider used to construct this TracingSymbolProvider. Adds a list of ShapeLinks to the TracingSymbolProvider's TraceFile.Builder.- Specified by:
toSymbol
in interfaceSymbolProvider
- Parameters:
shape
- Shape to convert to Symbol.- Returns:
- Symbol created from Shape.
-
toMemberName
public java.lang.String toMemberName(MemberShape shape)
Description copied from interface:SymbolProvider
Converts a member shape to a member/property name of a containing data structure.The default implementation will return the member name of the provided shape ID and should be overridden if necessary.
- Specified by:
toMemberName
in interfaceSymbolProvider
- Parameters:
shape
- Shape to convert.- Returns:
- Returns the converted member name.
-
-