com.twitter.scrooge.backend

TemplateGenerator

abstract class TemplateGenerator extends Generator with StructTemplate with ServiceTemplate with ConstsTemplate with EnumTemplate

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TemplateGenerator
  2. EnumTemplate
  3. ConstsTemplate
  4. ServiceTemplate
  5. StructTemplate
  6. Generator
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TemplateGenerator(resolvedDoc: ResolvedDocument)

Type Members

  1. case class Binding[FT <: FieldType](name: String, fieldType: FT) extends Product with Serializable

    Definition Classes
    StructTemplate

Abstract Value Members

  1. abstract val defaultNamespace: String

    Map from included file names to the namespaces defined in those files.

  2. abstract def fileExtension: String

  3. abstract def genBaseFinagleService: CodeFragment

  4. abstract def genEnum(enum: EnumRHS, fieldType: Option[FieldType] = None): CodeFragment

  5. abstract def genFieldParams(fields: Seq[Field], asVal: Boolean = false): CodeFragment

  6. abstract def genFieldType(f: Field): CodeFragment

  7. abstract def genList(list: ListRHS, fieldType: Option[FieldType] = None): CodeFragment

  8. abstract def genMap(map: MapRHS, fieldType: Option[FieldType] = None): CodeFragment

  9. abstract def genPrimitiveType(t: FunctionType): CodeFragment

  10. abstract def genSet(set: SetRHS, fieldType: Option[FieldType] = None): CodeFragment

  11. abstract def genStruct(struct: StructRHS, fieldType: Option[FieldType] = None): CodeFragment

  12. abstract def genType(t: FunctionType, immutable: Boolean = false): CodeFragment

  13. abstract def genUnion(union: UnionRHS, fieldType: Option[FieldType] = None): CodeFragment

  14. abstract def getParentFinagleClient(parent: ServiceParent): CodeFragment

  15. abstract def getParentFinagleService(parent: ServiceParent): CodeFragment

  16. abstract val languageFlags: Seq[String]

  17. 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
  18. abstract def quoteKeyword(str: String): String

  19. abstract def templates: HandlebarLoader

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val TypeTemplate: Dictionary

    Definition Classes
    StructTemplate
  7. 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
    TemplateGeneratorGenerator
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val basePassthrough: Dictionary

    Definition Classes
    StructTemplate
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def constDict(namespace: Identifier, consts: Seq[ConstDefinition]): Dictionary

    Definition Classes
    ConstsTemplate
  12. def enumDict(namespace: Identifier, enum: Enum): Dictionary

    Definition Classes
    EnumTemplate
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def fieldsToDict(fields: Seq[Field], blacklist: Seq[String], namespace: Option[Identifier] = None): Seq[Dictionary]

    Definition Classes
    StructTemplate
  16. def finagleClient(service: Service, namespace: Identifier, withAsClosable: Boolean): Dictionary

    Definition Classes
    ServiceTemplate
  17. def finagleClientFile(packageDir: File, service: Service, options: Set[ServiceOption]): Option[File]

  18. def finagleService(service: Service, namespace: Identifier): Dictionary

    Definition Classes
    ServiceTemplate
  19. def finagleServiceFile(packageDir: File, service: Service, options: Set[ServiceOption]): Option[File]

  20. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def functionArgsStruct(f: Function): FunctionArgs

    Definition Classes
    ServiceTemplate
  22. def functionDictionary(function: Function, generic: Option[String]): Dictionary

    Definition Classes
    ServiceTemplate
  23. def functionObjectName(f: Function): SimpleID

    Definition Classes
    ServiceTemplate
  24. def genConstType(t: FunctionType): CodeFragment

  25. def genConstant(constant: RHS, fieldType: Option[FieldType] = None): CodeFragment

  26. def genDecodeProtocolMethod(t: FunctionType): CodeFragment

  27. 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.

  28. def genDefaultFieldValueForFieldInfo(f: Field): Option[CodeFragment]

  29. def genDefaultReadValue(f: Field): CodeFragment

  30. def genDefaultValue(fieldType: FieldType): CodeFragment

    The default value for the specified type and mutability.

  31. def genID(data: Identifier): CodeFragment

  32. def genOffsetSkipProtocolMethod(t: FunctionType): CodeFragment

  33. def genProtocolReadMethod(t: FunctionType): CodeFragment

  34. def genProtocolSkipMethod(t: FunctionType): CodeFragment

  35. def genProtocolWriteMethod(t: FunctionType): CodeFragment

  36. def genQualifiedID(id: Identifier, namespace: Identifier): CodeFragment

  37. def genUnsafeEmptyReadValue(f: Field): CodeFragment

  38. 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.

  39. def genWireConstType(t: FunctionType): CodeFragment

    Definition Classes
    StructTemplate
  40. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  41. def getExceptionFields(result: FunctionResult): CodeFragment

    Definition Classes
    StructTemplate
  42. def getIncludeNamespace(includeFileName: String): Identifier

    Attributes
    protected
  43. def getNamespace(doc: Document): Identifier

  44. def getServiceParentID(parent: ServiceParent): Identifier

  45. def getSuccessType(result: FunctionResult): CodeFragment

    Definition Classes
    StructTemplate
  46. def getSuccessValue(result: FunctionResult): CodeFragment

    Definition Classes
    StructTemplate
  47. def getValidator(doc: Document): Option[Identifier]

  48. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  49. def includeMap: Map[String, ResolvedDocument]

    Definition Classes
    Generator
  50. 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
  51. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  52. def isLazyReadEnabled(t: FunctionType, optional: Boolean): Boolean

  53. def isNullValid(f: Field): Boolean

  54. def isNullableType(f: Field): Boolean

  55. def isPrimitive(t: FunctionType): Boolean

  56. def namespacedFolder(destFolder: File, namespace: String, dryRun: Boolean): File

    ****************** helper functions ***********************

    ****************** helper functions ***********************

    Attributes
    protected
  57. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  58. def normalizeCase[N <: Node](node: N): N

  59. final def notify(): Unit

    Definition Classes
    AnyRef
  60. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  61. def productN(fields: Seq[Field], namespace: Option[Identifier]): String

    Returns a String "_root_.

    Returns a String "_root_.scala.Product${N}[Type1, Type2, ...]" or "scala.Product".

  62. 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

  63. def quote(str: String): String

  64. def readWriteInfo[T <: FieldType](sid: SimpleID, t: FieldType): Dictionary

    Definition Classes
    StructTemplate
  65. val resolvedDoc: ResolvedDocument

  66. 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
  67. def serviceDict(service: Service, namespace: Identifier, includes: Seq[Include], options: Set[ServiceOption], genAdapt: Boolean): Dictionary

    Definition Classes
    ServiceTemplate
  68. def structDict(struct: StructLike, namespace: Option[Identifier], includes: Seq[Include], serviceOptions: Set[ServiceOption], genAdapt: Boolean, toplevel: Boolean = false, validator: Option[Identifier] = None): Dictionary

    Definition Classes
    StructTemplate
  69. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  70. def toString(): String

    Definition Classes
    AnyRef → Any
  71. def tupleN(fields: Seq[Field], namespace: Option[Identifier]): String

    Returns a String "_root_.

    Returns a String "_root_.scala.Tuple${N}[Type1, Type2, ...]"

  72. def unwrapArgs(arity: Int): String

    Definition Classes
    ServiceTemplate
  73. def validateStructAnnotations(structs: Seq[StructLike]): Unit

    Attributes
    protected
    Definition Classes
    Generator
  74. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. def writeFile(file: File, fileHeader: String, fileContent: String): Unit

    Attributes
    protected

Inherited from EnumTemplate

Inherited from ConstsTemplate

Inherited from ServiceTemplate

Inherited from StructTemplate

Inherited from Generator

Inherited from AnyRef

Inherited from Any

Ungrouped