Package io.sundr.model
Interface Renderable
-
- All Superinterfaces:
Node
- All Known Subinterfaces:
Expression,ExpressionOrStatement,Statement
- All Known Implementing Classes:
AnnotationRef,Assign,BinaryExpression,BitwiseAnd,BitwiseOr,Block,Break,Cast,ClassRef,Construct,Continue,Declare,Divide,Do,Enclosed,Equals,For,Foreach,GreaterThan,GreaterThanOrEqual,If,Index,InstanceOf,Inverse,Lambda,LeftShift,LessThan,LessThanOrEqual,LogicalAnd,LogicalOr,Method,MethodCall,Minus,Modulo,Multiply,Negative,NewArray,Not,NotEquals,Plus,Positive,PostDecrement,PostIncrement,PreDecrement,PreIncrement,PrimitiveRef,Property,PropertyRef,Return,RightShift,RightUnsignedShift,StringStatement,Switch,Ternary,This,TypeDef,TypeParamDef,TypeParamRef,TypeRef,ValueRef,VoidRef,While,WildcardRef,Xor
public interface Renderable extends Node
-
-
Field Summary
-
Fields inherited from interface io.sundr.model.Node
AT, CB, CC, CLP, COLN, COMA, CP, DOT, DQ, EMPTY, EQ, EXTENDS, GT, IMPLEMENTS, INDENT, JAVA_LANG, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_STRING, LT, NEWLINE, NEWLINE_PATTERN, OB, OC, OP, Q, SEMICOLN, SEMICOLN_SUFFIX_PATTERN, SPACE, STAR, THROWS, VARARG
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static StringnoSemicolon(String content)default Stringrender()Render the type into aStringfor the purpose of code generation.default Stringtab(String... content)Render the specified content adding a tab as indentation for each line.
-
-
-
Method Detail
-
render
default String render()
Render the type into aStringfor the purpose of code generation. This is slightly different from the `toString()` method as `toString()` is mostly needed for logging / debugging and should be idempotent. Regarding idempotency this method may yield different result based on the context it is used even if the internal state of the object does not change. An example of such case, is a reference to class that may change based on the package from which it's refenced.- Returns:
- the
Stringrepresentation of the object as it's meant to appear in the generated code.
-
tab
default String tab(String... content)
Render the specified content adding a tab as indentation for each line. Tab does not refer to the actual tab character but to two space characters. Thing of it as tab size 2 and expand tab to spaces.- Parameters:
content- one or more lines- Returns:
- the indented String
-
-