abstract class TemplateGenerator extends Generator with StructTemplate with ServiceTemplate with ConstsTemplate with EnumTemplate
- Alphabetic
- By Inheritance
- TemplateGenerator
- EnumTemplate
- ConstsTemplate
- ServiceTemplate
- StructTemplate
- Generator
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TemplateGenerator(resolvedDoc: ResolvedDocument)
Type Members
- case class Binding[FT <: FieldType](name: String, fieldType: FT) extends Product with Serializable
- Definition Classes
- StructTemplate
Abstract Value Members
- abstract val defaultNamespace: String
Map from included file names to the namespaces defined in those files.
- abstract def fileExtension: String
- abstract def genBaseFinagleService: CodeFragment
- abstract def genEnum(enum: EnumRHS, fieldType: Option[FieldType] = None): CodeFragment
- abstract def genFieldParams(fields: Seq[Field], asVal: Boolean = false): CodeFragment
- abstract def genFieldType(f: Field): CodeFragment
- abstract def genList(list: ListRHS, fieldType: Option[FieldType] = None): CodeFragment
- abstract def genMap(map: MapRHS, fieldType: Option[FieldType] = None): CodeFragment
- abstract def genPrimitiveType(t: FunctionType): CodeFragment
- abstract def genSet(set: SetRHS, fieldType: Option[FieldType] = None): CodeFragment
- abstract def genStruct(struct: StructRHS, fieldType: Option[FieldType] = None): CodeFragment
- abstract def genType(t: FunctionType, immutable: Boolean = false): CodeFragment
- abstract def genUnion(union: UnionRHS, fieldType: Option[FieldType] = None): CodeFragment
- abstract def getParentFinagleClient(parent: ServiceParent): CodeFragment
- abstract def getParentFinagleService(parent: ServiceParent): CodeFragment
- abstract val languageFlags: Seq[String]
- abstract def namespaceLanguage: String
Used to find the namespace in included files.
Used to find the namespace in included files. This does not need to match the corresponding GeneratorFactory.language.
- Definition Classes
- Generator
- abstract def quoteKeyword(str: String): String
- abstract def templates: HandlebarLoader
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val TypeTemplate: Dictionary
- Definition Classes
- StructTemplate
- def apply(serviceOptions: Set[ServiceOption], outputPath: File, dryRun: Boolean = false, genAdapt: Boolean = false): Iterable[File]
- genAdapt
Generate code for Adaptive Decoding. This flag is only used for scala presently.
- Definition Classes
- TemplateGenerator → Generator
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val basePassthrough: Dictionary
- Definition Classes
- StructTemplate
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def constDict(namespace: Identifier, consts: Seq[ConstDefinition]): Dictionary
- Definition Classes
- ConstsTemplate
- def enumDict(namespace: Identifier, enum: Enum): Dictionary
- Definition Classes
- EnumTemplate
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fieldsToDict(fields: Seq[Field], blacklist: Seq[String], namespace: Option[Identifier] = None): Seq[Dictionary]
- Definition Classes
- StructTemplate
- def finagleClient(service: Service, namespace: Identifier, withAsClosable: Boolean): Dictionary
- Definition Classes
- ServiceTemplate
- def finagleClientFile(packageDir: File, service: Service, options: Set[ServiceOption]): Option[File]
- def finagleService(service: Service, namespace: Identifier): Dictionary
- Definition Classes
- ServiceTemplate
- def finagleServiceFile(packageDir: File, service: Service, options: Set[ServiceOption]): Option[File]
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def functionArgsStruct(f: Function): FunctionArgs
- Definition Classes
- ServiceTemplate
- def functionDictionary(function: Function, generic: Option[String]): Dictionary
- Definition Classes
- ServiceTemplate
- def functionObjectName(f: Function): SimpleID
- Definition Classes
- ServiceTemplate
- def genConstType(t: FunctionType): CodeFragment
- def genConstant(constant: RHS, fieldType: Option[FieldType] = None): CodeFragment
- def genDecodeProtocolMethod(t: FunctionType): CodeFragment
- def genDefaultFieldValue(f: Field, forAlternateConstructor: Boolean = false): Option[CodeFragment]
Creates a code fragment for the default value of the field.
Creates a code fragment for the default value of the field.
- f
field to generate the default value for.
- forAlternateConstructor
Whether this is for the alternate Immutable constructor which does not take an Option for construction required fields.
- def genDefaultFieldValueForFieldInfo(f: Field): Option[CodeFragment]
- def genDefaultReadValue(f: Field): CodeFragment
- def genDefaultValue(fieldType: FieldType): CodeFragment
The default value for the specified type and mutability.
- def genID(data: Identifier): CodeFragment
- def genOffsetSkipProtocolMethod(t: FunctionType): CodeFragment
- def genProtocolReadMethod(t: FunctionType): CodeFragment
- def genProtocolSkipMethod(t: FunctionType): CodeFragment
- def genProtocolWriteMethod(t: FunctionType): CodeFragment
- def genQualifiedID(id: Identifier, namespace: Identifier): CodeFragment
- def genUnsafeEmptyReadValue(f: Field): CodeFragment
- def genUnsafeEmptyValue(fieldType: FieldType): CodeFragment
The default value for the unsafe empty value case.
The default value for the unsafe empty value case. These predefined values will be used to create field blob. For String, null is not valid value for required field.
- def genWireConstType(t: FunctionType): CodeFragment
- Definition Classes
- StructTemplate
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getExceptionFields(result: FunctionResult): CodeFragment
- Definition Classes
- StructTemplate
- def getIncludeNamespace(includeFileName: String): Identifier
- Attributes
- protected
- def getNamespace(doc: Document): Identifier
- def getServiceParentID(parent: ServiceParent): Identifier
- def getSuccessType(result: FunctionResult): CodeFragment
- Definition Classes
- StructTemplate
- def getSuccessValue(result: FunctionResult): CodeFragment
- Definition Classes
- StructTemplate
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def includeMap: Map[String, ResolvedDocument]
- Definition Classes
- Generator
- def internalArgsStructNameForWire(f: Function): String
The name used in RPC request, this needs to be same as Apache compiler
The name used in RPC request, this needs to be same as Apache compiler
- Definition Classes
- ServiceTemplate
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isLazyReadEnabled(t: FunctionType, optional: Boolean): Boolean
- def isNullableType(t: FieldType, isOptional: Boolean = false): Boolean
- def isPrimitive(t: FunctionType): Boolean
- def namespacedFolder(destFolder: File, namespace: String, dryRun: Boolean): File
****************** helper functions ***********************
****************** helper functions ***********************
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def normalizeCase[N <: Node](node: N): N
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productN(fields: Seq[Field], namespace: Option[Identifier]): String
Returns a String "_root_.scala.Product${N}[Type1, Type2, ...]" or "scala.Product".
- def qualifyNamedType(t: NamedType, namespace: Option[Identifier] = None): Identifier
When a named type is imported via include statement, we need to qualify it using its full namespace
- def quote(str: String): String
- def readWriteInfo[T <: FieldType](sid: SimpleID, t: FieldType): Dictionary
- Definition Classes
- StructTemplate
- val resolvedDoc: ResolvedDocument
- def resultStruct(f: Function): FunctionResult
Thrift Result struct that includes success or exceptions returned.
Thrift Result struct that includes success or exceptions returned.
- Definition Classes
- ServiceTemplate
- def serviceDict(service: Service, namespace: Identifier, includes: Seq[Include], options: Set[ServiceOption], genAdapt: Boolean): Dictionary
- Definition Classes
- ServiceTemplate
- def structDict(struct: StructLike, namespace: Option[Identifier], includes: Seq[Include], serviceOptions: Set[ServiceOption], genAdapt: Boolean, toplevel: Boolean = false): Dictionary
- Definition Classes
- StructTemplate
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tupleN(fields: Seq[Field], namespace: Option[Identifier]): String
Returns a String "_root_.scala.Tuple${N}[Type1, Type2, ...]"
- def unwrapArgs(arity: Int): String
- Definition Classes
- ServiceTemplate
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def writeFile(file: File, fileHeader: String, fileContent: String): Unit
- Attributes
- protected