Esempio n. 1
0
class SqlGenerator(Generator):
    from thryft.generators.sql.sql_binary_type import SqlBinaryType as BinaryType  # @UnusedImport
    from thryft.generators.sql.sql_bool_type import SqlBoolType as BoolType  # @UnusedImport
    from thryft.generators.sql.sql_byte_type import SqlByteType as ByteType  # @UnusedImport
    from thryft.generators.sql.sql_const import SqlConst as Const  # @UnusedImport
    from thryft.generators.sql.sql_document import SqlDocument as Document  # @UnusedImport
    from thryft.generators.sql.sql_double_type import SqlDoubleType as DoubleType  # @UnusedImport
    from thryft.generators.sql.sql_enum_type import SqlEnumType as EnumType  # @UnusedImport
    from thryft.generators.sql.sql_exception_type import SqlExceptionType as ExceptionType  # @UnusedImport
    from thryft.generators.sql.sql_field import SqlField as Field  # @UnusedImport
    from thryft.generators.sql.sql_function import SqlFunction as Function  # @UnusedImport
    from thryft.generators.sql.sql_i16_type import SqlI16Type as I16Type  # @UnusedImport
    from thryft.generators.sql.sql_i32_type import SqlI32Type as I32Type  # @UnusedImport
    from thryft.generators.sql.sql_i64_type import SqlI64Type as I64Type  # @UnusedImport
    from thryft.generators.sql.sql_include import SqlInclude as Include  # @UnusedImport
    from thryft.generators.sql.sql_list_type import SqlListType as ListType  # @UnusedImport
    from thryft.generators.sql.sql_map_type import SqlMapType as MapType  # @UnusedImport
    from thryft.generators.sql.sql_service import SqlService as Service  # @UnusedImport
    from thryft.generators.sql.sql_set_type import SqlSetType as SetType  # @UnusedImport
    from thryft.generators.sql.sql_string_type import SqlStringType as StringType  # @UnusedImport
    from thryft.generators.sql.sql_struct_type import SqlStructType as StructType  # @UnusedImport
    from thryft.generators.sql.sql_typedef import SqlTypedef as Typedef  # @UnusedImport


Parser.register_annotation_parser(
    AnnotationParser('sql_column', Ast.StructTypeNode))
Parser.register_annotation_parser(SqlForeignKeyAnnotationParser())
Parser.register_annotation_parser(
    ValuelessAnnotationParser('sql_unique', Ast.FieldNode))
Esempio n. 2
0
    def __init__(self, default_methods=False, function_overloads=False, mutable_compound_types=False, namespace_prefix=None, **kwds):
        Generator.__init__(self, **kwds)
        self.__default_methods = default_methods
        self.__function_overloads = function_overloads
        self.__mutable_compound_types = mutable_compound_types
        self.__namespace_prefix = namespace_prefix

    @property
    def default_methods(self):
        return self.__default_methods

    @property
    def function_overloads(self):
        return self.__function_overloads

    @property
    def mutable_compound_types(self):
        return self.__mutable_compound_types

    @property
    def namespace_prefix(self):
        return self.__namespace_prefix


Parser.register_annotation_parser(JavaFinalAnnotationParser())
Parser.register_annotation_parser(AnnotationParser('java_extends', (Ast.ExceptionTypeNode, Ast.StructTypeNode)))
Parser.register_annotation_parser(AnnotationParser('java_implements', (Ast.EnumTypeNode, Ast.ExceptionTypeNode, Ast.ServiceNode, Ast.StructTypeNode)))
Parser.register_annotation_parser(ValuelessAnnotationParser('java_escape_to_string', Ast.FieldNode))
Parser.register_annotation_parser(ValuelessAnnotationParser('java_exclude_from_to_string', Ast.FieldNode))