hydra.java.serde module

Java serializer: converts Java AST to concrete syntax.

hydra.java.serde.additional_bound_to_expr(ab: AdditionalBound) → Expr
hydra.java.serde.additive_expression_to_expr(e: AdditiveExpression) → Expr
hydra.java.serde.ambiguous_name_to_expr(an: AmbiguousName) → Expr
hydra.java.serde.and_expression_to_expr(ae: AndExpression) → Expr
hydra.java.serde.annotated_identifier_to_expr(ai: AnnotatedIdentifier) → Expr
hydra.java.serde.annotation_to_expr(ann: Annotation) → Expr
hydra.java.serde.annotation_type_declaration_to_expr(_: T0) → Expr
hydra.java.serde.array_access_to_expr(_: T0) → Expr
hydra.java.serde.array_creation_expression_to_expr(ace: ArrayCreationExpression) → Expr
hydra.java.serde.array_initializer_to_expr(ai: ArrayInitializer) → Expr
hydra.java.serde.array_type_to_expr(at: ArrayType) → Expr
hydra.java.serde.assert_statement_to_expr(_: T0) → Expr
hydra.java.serde.assignment_expression_to_expr(e: AssignmentExpression) → Expr
hydra.java.serde.assignment_to_expr(a: Assignment) → Expr
hydra.java.serde.block_statement_to_expr(s: BlockStatement) → Expr
hydra.java.serde.block_to_expr(b: Block) → Expr
hydra.java.serde.break_statement_to_expr(bs: BreakStatement) → Expr
hydra.java.serde.cast_expression_lambda_to_expr(_: T0) → Expr
hydra.java.serde.cast_expression_not_plus_minus_to_expr(npm: CastExpression_NotPlusMinus) → Expr
hydra.java.serde.cast_expression_primitive_to_expr(cp: CastExpression_Primitive) → Expr
hydra.java.serde.cast_expression_ref_and_bounds_to_expr(rab: CastExpression_RefAndBounds) → Expr
hydra.java.serde.cast_expression_to_expr(e: CastExpression) → Expr
hydra.java.serde.class_body_declaration_to_expr(d: ClassBodyDeclaration) → Expr
hydra.java.serde.class_body_declaration_with_comments_to_expr(cbdwc: ClassBodyDeclarationWithComments) → Expr
hydra.java.serde.class_body_to_expr(cb: ClassBody) → Expr
hydra.java.serde.class_declaration_to_expr(d: ClassDeclaration) → Expr
hydra.java.serde.class_instance_creation_expression_qualifier_to_expr(q: ClassInstanceCreationExpression_Qualifier) → Expr
hydra.java.serde.class_instance_creation_expression_to_expr(cice: ClassInstanceCreationExpression) → Expr
hydra.java.serde.class_literal_to_expr(_: T0) → Expr
hydra.java.serde.class_member_declaration_to_expr(d: ClassMemberDeclaration) → Expr
hydra.java.serde.class_modifier_to_expr(m: ClassModifier) → Expr
hydra.java.serde.class_or_interface_type_to_expr(cit: ClassOrInterfaceType) → Expr
hydra.java.serde.class_or_interface_type_to_instantiate_to_expr(coitti: ClassOrInterfaceTypeToInstantiate) → Expr
hydra.java.serde.class_type_to_expr(ct: ClassType) → Expr
hydra.java.serde.compilation_unit_to_expr(u: CompilationUnit) → Expr
hydra.java.serde.conditional_and_expression_to_expr(cae: ConditionalAndExpression) → Expr
hydra.java.serde.conditional_expression_ternary_cond_to_expr(_: T0) → Expr
hydra.java.serde.conditional_expression_ternary_lambda_to_expr(_: T0) → Expr
hydra.java.serde.conditional_expression_to_expr(c: ConditionalExpression) → Expr
hydra.java.serde.conditional_or_expression_to_expr(coe: ConditionalOrExpression) → Expr
hydra.java.serde.constant_declaration_to_expr(cd: ConstantDeclaration) → Expr
hydra.java.serde.constant_modifier_to_expr(_: T0) → Expr
hydra.java.serde.constructor_body_to_expr(cb: ConstructorBody) → Expr
hydra.java.serde.constructor_declaration_to_expr(cd: ConstructorDeclaration) → Expr
hydra.java.serde.constructor_declarator_to_expr(cd: ConstructorDeclarator) → Expr
hydra.java.serde.constructor_modifier_to_expr(m: ConstructorModifier) → Expr
hydra.java.serde.continue_statement_to_expr(cs: ContinueStatement) → Expr
hydra.java.serde.dims_to_expr(d: Dims) → Expr
hydra.java.serde.do_statement_to_expr(_: T0) → Expr
hydra.java.serde.element_value_pair_to_expr(evp: ElementValuePair) → Expr
hydra.java.serde.element_value_to_expr(ev: ElementValue) → Expr
hydra.java.serde.enum_declaration_to_expr(_: T0) → Expr
hydra.java.serde.equality_expression_to_expr(e: EqualityExpression) → Expr
hydra.java.serde.exclusive_or_expression_to_expr(eoe: ExclusiveOrExpression) → Expr
hydra.java.serde.explicit_constructor_invocation_to_expr(_: T0) → Expr
hydra.java.serde.expression_name_to_expr(en: ExpressionName) → Expr
hydra.java.serde.expression_statement_to_expr(es: ExpressionStatement) → Expr
hydra.java.serde.expression_to_expr(e: Expression) → Expr
hydra.java.serde.field_access_to_expr(fa: FieldAccess) → Expr
hydra.java.serde.field_declaration_to_expr(fd: FieldDeclaration) → Expr
hydra.java.serde.field_modifier_to_expr(m: FieldModifier) → Expr
hydra.java.serde.floating_point_literal_to_expr(fl: FloatingPointLiteral) → Expr
hydra.java.serde.floating_point_type_to_expr(ft: FloatingPointType) → Expr
hydra.java.serde.for_statement_to_expr(_: T0) → Expr
hydra.java.serde.formal_parameter_simple_to_expr(fps: FormalParameter_Simple) → Expr
hydra.java.serde.formal_parameter_to_expr(p: FormalParameter) → Expr
hydra.java.serde.identifier_to_expr(id: Identifier) → Expr
hydra.java.serde.if_then_else_statement_to_expr(_: T0) → Expr
hydra.java.serde.if_then_statement_to_expr(its: IfThenStatement) → Expr
hydra.java.serde.import_declaration_to_expr(imp: ImportDeclaration) → Expr
hydra.java.serde.inclusive_or_expression_to_expr(ioe: InclusiveOrExpression) → Expr
hydra.java.serde.instance_initializer_to_expr(_: T0) → Expr
hydra.java.serde.integer_literal_to_expr(il: IntegerLiteral) → Expr
hydra.java.serde.integral_type_to_expr(t: IntegralType) → Expr
hydra.java.serde.interface_body_to_expr(ib: InterfaceBody) → Expr
hydra.java.serde.interface_declaration_to_expr(d: InterfaceDeclaration) → Expr
hydra.java.serde.interface_member_declaration_to_expr(d: InterfaceMemberDeclaration) → Expr
hydra.java.serde.interface_member_declaration_with_comments_to_expr(imdwc: InterfaceMemberDeclarationWithComments) → Expr
hydra.java.serde.interface_method_declaration_to_expr(imd: InterfaceMethodDeclaration) → Expr
hydra.java.serde.interface_method_modifier_to_expr(m: InterfaceMethodModifier) → Expr
hydra.java.serde.interface_modifier_to_expr(m: InterfaceModifier) → Expr
hydra.java.serde.interface_type_to_expr(it: InterfaceType) → Expr
hydra.java.serde.java_doc_entity_ref(ref: EntityReference) → str

Render a hydra.packaging.EntityReference as Javadoc link syntax.

hydra.java.serde.java_float_literal_text(s: str) → str
hydra.java.serde.labeled_statement_to_expr(_: T0) → Expr
hydra.java.serde.lambda_body_to_expr(b: LambdaBody) → Expr
hydra.java.serde.lambda_expression_to_expr(le: LambdaExpression) → Expr
hydra.java.serde.lambda_parameters_to_expr(p: LambdaParameters) → Expr
hydra.java.serde.left_hand_side_to_expr(lhs: LeftHandSide) → Expr
hydra.java.serde.literal_to_expr(l: Literal) → Expr
hydra.java.serde.local_name_to_expr(t: LocalVariableType) → Expr
hydra.java.serde.local_variable_declaration_statement_to_expr(lvds: LocalVariableDeclarationStatement) → Expr
hydra.java.serde.local_variable_declaration_to_expr(lvd: LocalVariableDeclaration) → Expr
hydra.java.serde.marker_annotation_to_expr(ma: MarkerAnnotation) → Expr
hydra.java.serde.method_body_to_expr(b: MethodBody) → Expr
hydra.java.serde.method_declaration_to_expr(md: MethodDeclaration) → Expr
hydra.java.serde.method_declarator_to_expr(md: MethodDeclarator) → Expr
hydra.java.serde.method_header_to_expr(mh: MethodHeader) → Expr
hydra.java.serde.method_invocation_to_expr(mi: MethodInvocation) → Expr
hydra.java.serde.method_modifier_to_expr(m: MethodModifier) → Expr
hydra.java.serde.method_name_to_expr(mn: MethodName) → Expr
hydra.java.serde.method_reference_to_expr(_: T0) → Expr
hydra.java.serde.multiplicative_expression_to_expr(e: MultiplicativeExpression) → Expr
hydra.java.serde.normal_annotation_to_expr(na: NormalAnnotation) → Expr
hydra.java.serde.normal_class_declaration_to_expr(ncd: NormalClassDeclaration) → Expr
hydra.java.serde.normal_interface_declaration_to_expr(nid: NormalInterfaceDeclaration) → Expr
hydra.java.serde.numeric_type_to_expr(nt: NumericType) → Expr
hydra.java.serde.package_declaration_to_expr(pd: PackageDeclaration) → Expr
hydra.java.serde.package_modifier_to_expr(pm: PackageModifier) → Expr
hydra.java.serde.package_name_to_expr(pn: PackageName) → Expr
hydra.java.serde.package_or_type_name_to_expr(potn: PackageOrTypeName) → Expr
hydra.java.serde.post_decrement_expression_to_expr(_: T0) → Expr
hydra.java.serde.post_increment_expression_to_expr(_: T0) → Expr
hydra.java.serde.postfix_expression_to_expr(e: PostfixExpression) → Expr
hydra.java.serde.pre_decrement_expression_to_expr(_: T0) → Expr
hydra.java.serde.pre_increment_expression_to_expr(_: T0) → Expr
hydra.java.serde.primary_no_new_array_expression_expression_to_expr(p: PrimaryNoNewArrayExpression) → Expr
hydra.java.serde.primary_to_expr(p: Primary) → Expr
hydra.java.serde.primitive_type_to_expr(pt: PrimitiveType) → Expr
hydra.java.serde.primitive_type_with_annotations_to_expr(ptwa: PrimitiveTypeWithAnnotations) → Expr
hydra.java.serde.receiver_parameter_to_expr(_: T0) → Expr
hydra.java.serde.reference_type_to_expr(rt: ReferenceType) → Expr
hydra.java.serde.relational_expression_greater_than_equal_to_expr(gte: RelationalExpression_GreaterThanEqual) → Expr
hydra.java.serde.relational_expression_greater_than_to_expr(gt: RelationalExpression_GreaterThan) → Expr
hydra.java.serde.relational_expression_instance_of_to_expr(io: InstanceofExpression) → Expr
hydra.java.serde.relational_expression_less_than_equal_to_expr(lte: RelationalExpression_LessThanEqual) → Expr
hydra.java.serde.relational_expression_less_than_to_expr(lt: RelationalExpression_LessThan) → Expr
hydra.java.serde.relational_expression_to_expr(e: RelationalExpression) → Expr
hydra.java.serde.result_to_expr(r: Result) → Expr
hydra.java.serde.return_statement_to_expr(rs: ReturnStatement) → Expr
hydra.java.serde.sanitize_java_comment(s: str) → str

Sanitize a string for use in a Java comment.

hydra.java.serde.shift_expression_to_expr(e: ShiftExpression) → Expr
hydra.java.serde.simple_type_name_to_expr(stn: SimpleTypeName) → Expr
hydra.java.serde.single_element_annotation_to_expr(sea: SingleElementAnnotation) → Expr
hydra.java.serde.single_line_comment(c: str) → Expr

Create a single-line Java comment. Empty text emits // (no trailing space) so blank line comments don’t carry trailing whitespace.

hydra.java.serde.statement_expression_to_expr(e: StatementExpression) → Expr
hydra.java.serde.statement_to_expr(s: Statement) → Expr
hydra.java.serde.statement_without_trailing_substatement_to_expr(s: StatementWithoutTrailingSubstatement) → Expr
hydra.java.serde.static_initializer_to_expr(_: T0) → Expr
hydra.java.serde.string_literal_to_expr(sl: StringLiteral) → Expr

Serialize a Java string literal with proper Unicode escaping.

hydra.java.serde.switch_statement_to_expr(_: T0) → Expr
hydra.java.serde.synchronized_statement_to_expr(_: T0) → Expr
hydra.java.serde.throw_statement_to_expr(ts: ThrowStatement) → Expr
hydra.java.serde.throws_to_expr(_: T0) → Expr
hydra.java.serde.try_statement_to_expr(_: T0) → Expr
hydra.java.serde.type_argument_to_expr(a: TypeArgument) → Expr
hydra.java.serde.type_arguments_or_diamond_to_expr(targs: TypeArgumentsOrDiamond) → Expr
hydra.java.serde.type_bound_to_expr(b: TypeBound) → Expr
hydra.java.serde.type_declaration_to_expr(d: TopLevelClassOrInterfaceDeclaration) → Expr
hydra.java.serde.type_declaration_with_comments_to_expr(tdwc: TopLevelClassOrInterfaceDeclarationWithComments) → Expr
hydra.java.serde.type_identifier_to_expr(tid: TypeIdentifier) → Expr
hydra.java.serde.type_name_to_expr(tn: TypeName) → Expr
hydra.java.serde.type_parameter_modifier_to_expr(tpm: TypeParameterModifier) → Expr
hydra.java.serde.type_parameter_to_expr(tp: TypeParameter) → Expr
hydra.java.serde.type_to_expr(t: Type) → Expr
hydra.java.serde.type_variable_to_expr(tv: TypeVariable) → Expr
hydra.java.serde.unann_type_to_expr(ut: UnannType) → Expr
hydra.java.serde.unary_expression_not_plus_minus_to_expr(e: UnaryExpressionNotPlusMinus) → Expr
hydra.java.serde.unary_expression_to_expr(e: UnaryExpression) → Expr
hydra.java.serde.unqualified_class_instance_creation_expression_to_expr(ucice: UnqualifiedClassInstanceCreationExpression) → Expr
hydra.java.serde.variable_arity_parameter_to_expr(_: T0) → Expr
hydra.java.serde.variable_declarator_id_to_expr(vdi: VariableDeclaratorId) → Expr
hydra.java.serde.variable_declarator_to_expr(vd: VariableDeclarator) → Expr
hydra.java.serde.variable_initializer_to_expr(i: VariableInitializer) → Expr
hydra.java.serde.variable_modifier_to_expr(m: VariableModifier) → Expr
hydra.java.serde.while_statement_to_expr(ws: WhileStatement) → Expr
hydra.java.serde.wildcard_bounds_to_expr(b: WildcardBounds) → Expr
hydra.java.serde.wildcard_to_expr(w: Wildcard) → Expr
hydra.java.serde.with_comments(mc: object, expr: Expr) → Expr

Wrap an expression with optional Javadoc comments. Blank lines inside the doc body emit ` *` (no trailing space) instead of ` * `.