public class JavaUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JavaUtil.Separators |
Constructor and Description |
---|
JavaUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
append(java.lang.StringBuilder builder,
java.lang.String indent,
java.lang.String line)
Shortcut to append a line of generated code
|
static java.lang.String |
charset(java.lang.String encoding)
Code to fetch an instance of
Charset corresponding to the given encoding. |
static java.lang.String |
formatClassName(java.lang.String value)
Format a class name for the generated code.
|
static java.lang.String |
formatPropertyName(java.lang.String value)
Format a property name for generated code.
|
static java.lang.String |
generateFlyweightPropertyJavadoc(java.lang.String indent,
Token propertyToken,
java.lang.String typeName)
Generate the Javadoc comment header for flyweight property.
|
static java.lang.String |
generateGroupEncodePropertyJavadoc(java.lang.String indent,
Token propertyToken,
java.lang.String typeName)
Generate the Javadoc comment header for group encode property.
|
static java.lang.String |
generateLiteral(PrimitiveType type,
java.lang.String value)
Generate a literal value to be used in code generation.
|
static java.lang.String |
generateOptionDecodeJavadoc(java.lang.String indent,
Token optionToken)
Generate the Javadoc comment header for a bitset choice option decode method.
|
static java.lang.String |
generateOptionEncodeJavadoc(java.lang.String indent,
Token optionToken)
Generate the Javadoc comment header for a bitset choice option encode method.
|
static java.lang.String |
generateTypeJavadoc(java.lang.String indent,
Token typeToken)
Generate the Javadoc comment header for a type.
|
static java.lang.String |
javaTypeName(PrimitiveType primitiveType)
Map the name of a
PrimitiveType to a Java primitive type name. |
public static java.lang.String javaTypeName(PrimitiveType primitiveType)
PrimitiveType
to a Java primitive type name.primitiveType
- to map.public static java.lang.String formatPropertyName(java.lang.String value)
If the formatted property name is a keyword then SbeTool.KEYWORD_APPEND_TOKEN
is appended if set.
value
- to be formatted.java.lang.IllegalStateException
- if a keyword and SbeTool.KEYWORD_APPEND_TOKEN
is not set.public static java.lang.String formatClassName(java.lang.String value)
value
- to be formatted.public static void append(java.lang.StringBuilder builder, java.lang.String indent, java.lang.String line)
builder
- string builder to which to append the lineindent
- current text indentationline
- line to be appendedpublic static java.lang.String charset(java.lang.String encoding)
Charset
corresponding to the given encoding.encoding
- as a string name (eg. UTF-8).public static java.lang.String generateLiteral(PrimitiveType type, java.lang.String value)
type
- of the lateral value.value
- of the lateral.public static java.lang.String generateTypeJavadoc(java.lang.String indent, Token typeToken)
indent
- level for the comment.typeToken
- for the type.public static java.lang.String generateOptionDecodeJavadoc(java.lang.String indent, Token optionToken)
indent
- level for the comment.optionToken
- for the type.public static java.lang.String generateOptionEncodeJavadoc(java.lang.String indent, Token optionToken)
indent
- level for the comment.optionToken
- for the type.public static java.lang.String generateFlyweightPropertyJavadoc(java.lang.String indent, Token propertyToken, java.lang.String typeName)
indent
- level for the comment.propertyToken
- for the property name.typeName
- for the property type.public static java.lang.String generateGroupEncodePropertyJavadoc(java.lang.String indent, Token propertyToken, java.lang.String typeName)
indent
- level for the comment.propertyToken
- for the property name.typeName
- for the property type.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.