import { CaseStyle } from "./Casing/CaseStyle" ; import { Import } from "./Imports/Import" ; import { ImportRelativity } from "./Imports/ImportRelativity" ; import { Language } from "./Language" ; import { GeneralProperties } from "./Properties/GeneralProperties" ; import { ProjectProperties } from "./Properties/ProjectProperties" ; import { ArrayNewSizedSyntax } from "./Properties/Syntax/ArrayNewSizedSyntax" ; import { ArraySyntax } from "./Properties/Syntax/ArraySyntax" ; import { BooleanSyntax } from "./Properties/Syntax/BooleanSyntax" ; import { ClassGenericSyntax } from "./Properties/Syntax/ClassGenericSyntax" ; import { ClassMemberFunctionSyntax } from "./Properties/Syntax/ClassMemberFunctionSyntax" ; import { ClassMemberVariableSyntax } from "./Properties/Syntax/ClassMemberVariableSyntax" ; import { ClassStaticFunctionSyntax } from "./Properties/Syntax/ClassStaticFunctionSyntax" ; import { ClassStaticVariableSyntax } from "./Properties/Syntax/ClassStaticVariableSyntax" ; import { ClassSyntax } from "./Properties/Syntax/ClassSyntax" ; import { CommentSyntax } from "./Properties/Syntax/CommentSyntax" ; import { ConditionalSyntax } from "./Properties/Syntax/ConditionalSyntax" ; import { DictionarySyntax } from "./Properties/Syntax/DictionarySyntax" ; import { EnumSyntax } from "./Properties/Syntax/EnumSyntax" ; import { ExceptionSyntax } from "./Properties/Syntax/ExceptionSyntax" ; import { ExportSyntax } from "./Properties/Syntax/ExportSyntax" ; import { FileSyntax } from "./Properties/Syntax/FileSyntax" ; import { FunctionSyntax } from "./Properties/Syntax/FunctionSyntax" ; import { ImportSyntax } from "./Properties/Syntax/ImportSyntax" ; import { InterfaceSyntax } from "./Properties/Syntax/InterfaceSyntax" ; import { LambdaSyntax } from "./Properties/Syntax/LambdaSyntax" ; import { LambdaTypeInlineSyntax } from "./Properties/Syntax/LambdaTypeInlineSyntax" ; import { ListNewItemsSyntax } from "./Properties/Syntax/ListNewItemsSyntax" ; import { ListNewSizedSyntax } from "./Properties/Syntax/ListNewSizedSyntax" ; import { ListSliceSupport , ListSliceSyntax } from "./Properties/Syntax/ListSliceSyntax" ; import { ListSortMembersSyntax , ListSortMemberType } from "./Properties/Syntax/ListSortMembersSyntax" ; import { ListSyntax } from "./Properties/Syntax/ListSyntax" ; import { LoopSyntax } from "./Properties/Syntax/LoopSyntax" ; import { MainSyntax } from "./Properties/Syntax/MainSyntax" ; import { MathSyntax } from "./Properties/Syntax/MathSyntax" ; import { NativeCallScope , NativeCallSyntax , NativeCallType } from "./Properties/Syntax/NativeCallSyntax" ; import { NewInstantiationSyntaxKind , NewSyntax } from "./Properties/Syntax/NewSyntax" ; import { OperatorSyntax } from "./Properties/Syntax/OperatorSyntax" ; import { ParameterSyntax } from "./Properties/Syntax/ParameterSyntax" ; import { PrintingSyntax } from "./Properties/Syntax/PrintingSyntax" ; import { SetSyntax } from "./Properties/Syntax/SetSyntax" ; import { StandaloneFunctionSyntax } from "./Properties/Syntax/StandaloneFunctionSyntax" ; import { StringFormatSyntax } from "./Properties/Syntax/StringFormatSyntax" ; import { StringSubstringSupport , StringSubstringSyntax } from "./Properties/Syntax/StringSubstringSyntax" ; import { StringSyntax } from "./Properties/Syntax/StringSyntax" ; import { StringToNumberStartConversionType , StringToNumberSyntax } from "./Properties/Syntax/StringToNumberSyntax" ; import { StyleSyntax } from "./Properties/Syntax/StyleSyntax" ; import { UnsupportedSyntax } from "./Properties/Syntax/UnsupportedSyntax" ; import { VariableSyntax } from "./Properties/Syntax/VariableSyntax" ; /**
 * A summary of information for the Java language.
 */ export class Java extends Language { param projects protected generateProjectProperties ( projects ) { projects . mainFile = "Main.java" ; projects . metadataFiles = { "pom.xml" : [ `<?xml version="1.0" encoding="UTF-8"?>` , `<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">` , `    <modelVersion>4.0.0</modelVersion>` , `` , `    <licenses>` , `        <license>` , `            <name>{license}</name>` , `            <distribution>repo</distribution>` , `        </license>` , `    </licenses>` , `` , `    <scm>` , `        <url>{url}</url>` , `    </scm>` , `</project>` , ] , } ; projects . nameFormat = CaseStyle . PackageLowerCase ; } param general protected generateGeneralProperties ( general ) { general . directoryCase = CaseStyle . PascalCase ; general . extension = ".java" ; general . fileCase = CaseStyle . PascalCase ; general . name = "Java" ; } param members protected generateClassGenericSyntax ( generics ) { generics . left = "<" ; generics . middle = ", " ; generics . right = ">" ; } param arrays protected generateArraySyntax ( arrays ) { arrays . className = "Array" ; arrays . initializeAsNew = true ; arrays . initializeByType = true ; arrays . length = new NativeCallSyntax ( "length" , NativeCallScope . Member , NativeCallType . Property ) ; arrays . newGenericCastRequired = true ; arrays . requiredImports = [ new Import ( [ "java" , "util" ] , [ "Arrays" ] , ImportRelativity . Absolute ) ] ; } param arrays protected generateArrayNewSizedSyntax ( newSized ) { newSized . includeType = true ; newSized . left = "new " ; newSized . middle = "[" ; newSized . right = "]" ; } param booleans protected generateBooleanSyntax ( booleans ) { booleans . className = "boolean" ; } param functions protected generateClassMemberFunctionSyntax ( functions ) { functions . privatePrefix = "" ; functions . protectedPrefix = "" ; functions . publicPrefix = "" ; functions . abstractDeclaration = "abstract " ; functions . includeThisReference = false ; functions . private = "private " ; functions . privateCase = CaseStyle . CamelCase ; functions . protected = "protected " ; functions . protectedCase = CaseStyle . CamelCase ; functions . public = "public " ; functions . publicCase = CaseStyle . CamelCase ; } param members protected generateClassMemberVariableSyntax ( variables ) { variables . privateCase = CaseStyle . CamelCase ; variables . privatePrefix = "" ; variables . protectedPrefix = "" ; variables . publicPrefix = "" ; variables . private = "private " ; variables . protected = "protected " ; variables . protectedCase = CaseStyle . CamelCase ; variables . public = "public " ; variables . publicCase = CaseStyle . CamelCase ; } param classes protected generateClassSyntax ( classes ) { classes . declareEnd = "}" ; classes . declareExtendsRight = "" ; classes . declareStartLeft = "class " ; classes . newStart = "new " ; classes . statics . labelBeforePublicity = false ; classes . this = "this" ; classes . abstractDeclaration = "abstract " ; classes . abstractsSupported = true ; classes . aliases = { boolean : "Boolean" , dictionary : "HashMap" , double : "Double" , int : "Integer" , list : "ArrayList" , string : "String" , } ; classes . constructors . baseConstructor = "super" ; classes . constructors . private = "private " ; classes . constructors . protected = "protected " ; classes . constructors . public = "public " ; classes . declareExtendsLeft = " extends " ; classes . declareImplementsLeft = " implements " ; classes . declareStartRight = " {" ; classes . instanceOf = new NativeCallSyntax ( " instanceof " , NativeCallScope . Operator , NativeCallType . FloatingRight ) ; classes . generics . used = true ; } param functions protected generateClassStaticFunctionSyntax ( functions ) { functions . label = "static " ; functions . privatePrefix = "" ; functions . protectedPrefix = "" ; functions . publicPrefix = "" ; functions . private = "private " ; functions . privateCase = CaseStyle . CamelCase ; functions . protected = "protected " ; functions . protectedCase = CaseStyle . CamelCase ; functions . public = "public " ; functions . publicCase = CaseStyle . CamelCase ; } param members protected generateClassStaticVariableSyntax ( variables ) { variables . label = "static " ; variables . privateCase = CaseStyle . CamelCase ; variables . privatePrefix = "" ; variables . protectedPrefix = "" ; variables . publicPrefix = "" ; variables . private = "private " ; variables . privateCase = CaseStyle . CamelCase ; variables . protected = "protected " ; variables . protectedCase = CaseStyle . CamelCase ; variables . public = "public " ; variables . publicCase = CaseStyle . CamelCase ; } param comments protected generateCommentSyntax ( comments ) { comments . blockEnd = "*/" ; comments . blockLineLeft = "" ; comments . blockLineRight = "" ; comments . blockStart = "/*" ; comments . lineLeft = "// " ; comments . lineRight = "" ; comments . docEnd = " */" ; comments . docLineEnd = "" ; comments . docLineStart = " * " ; comments . docTagAliases = { note : "remarks" , parameter : "param" , returns : "returns" , summary : "" , todo : "todo" , } ; comments . docTagsWithParameters = { parameter : "" , summary : "\0" , } ; comments . docTagEnd = " " ; comments . docTagSpaceAfter = "  " ; comments . docTagStart = "@" ; comments . docStart = "/**" ; } param conditionals protected generateConditionalSyntax ( conditionals ) { conditionals . elif = "else if" ; conditionals . else = "else" ; conditionals . end = "}" ; conditionals . if = "if" ; conditionals . startLeft = " (" ; conditionals . continueLeft = "} " ; conditionals . continueRight = " {" ; conditionals . startRight = ") {" ; } param dictionaries protected generateDictionarySyntax ( dictionaries ) { dictionaries . className = "HashMap" ; dictionaries . containsKey = new NativeCallSyntax ( "containsKey" , NativeCallScope . Member , NativeCallType . Function ) ; dictionaries . getLeft = ".get(" ; dictionaries . getRight = ")" ; dictionaries . initializeAsNew = true ; dictionaries . initializeEnd = "}}" ; dictionaries . initializePairComma = "" ; dictionaries . initializePairLeft = "put(" ; dictionaries . initializePairMiddle = ", " ; dictionaries . initializePairRight = ");" ; dictionaries . initializeStart = "() {{" ; dictionaries . keys = new NativeCallSyntax ( "keySet" , NativeCallScope . Member , NativeCallType . Function ) ; dictionaries . requiredImports = [ new Import ( [ "java" , "util" ] , [ "HashMap" ] , ImportRelativity . Absolute ) ] ; dictionaries . setLeft = ".put(" ; dictionaries . setMiddle = ", " ; dictionaries . setRight = ")" ; dictionaries . typeLeft = "<" ; dictionaries . typeMiddle = ", " ; dictionaries . typeRight = ">" ; } param enums protected generateEnumSyntax ( enums ) { enums . declareCommaRight = "," ; enums . declareLastRight = "" ; enums . declareExternal = "enum {0} {" ; enums . declareInternal = "enum {0} {" ; enums . declareValues = false ; enums . isObject = false ; enums . requiredImports = [ ] ; enums . valueLeft = "" ; enums . valueMiddle = "." ; enums . valueRight = "" ; } param exceptions protected generateExceptionSyntax ( exceptions ) { exceptions . blockEnd = "} " ; exceptions . catch = "catch" ; exceptions . catchStartLink = " " ; exceptions . catchStartMiddle = " (" ; exceptions . catchStartRight = ") {" ; exceptions . className = "Exception" ; exceptions . finally = "finally" ; exceptions . finallyStartRight = " {" ; exceptions . requiredImports = [ ] ; exceptions . requiresExceptionType = true ; exceptions . throw = "throw new" ; exceptions . throwMiddle = "(" ; exceptions . throwRight = ")" ; exceptions . try = "try" ; exceptions . tryStartRight = " {" ; exceptions . variablePrefix = "" ; } param members protected generateExportSyntax ( exports ) { exports . exportedLeft = "public " ; exports . internal = "" ; } param files protected generateFileSyntax ( files ) { files . endLines = [ ] ; files . importsAfterStartLines = true ; files . indentation = 0 ; files . startCase = CaseStyle . PackageLowerCase ; files . startLines = [ "package {1};" , "" ] ; } param functions protected generateFunctionSyntax ( functions ) { functions . case = CaseStyle . CamelCase ; functions . defineEnd = "}" ; functions . defineStartLeft = " " ; functions . defineStartRight = " {" ; functions . explicitNewStaticGenericType = true ; functions . explicitReturns = true ; functions . explicitThrows = true ; functions . requiresExceptions = true ; functions . throwsMarker = " throws " ; } param imports protected generateImportSyntax ( imports ) { imports . case = CaseStyle . PackageLowerCase ; imports . explicitItems = true ; imports . explicitLines = true ; imports . leftAbsolute = "import " ; imports . leftLocal = "import " ; imports . middle = "." ; imports . right = ";" ; } param interfaces protected generateInterfaceSyntax ( interfaces ) { interfaces . declareStartLeft = "interface " ; interfaces . declareStartRight = " {" ; interfaces . declareExtendsLeft = " extends " ; interfaces . declareExtendsRight = ", " ; interfaces . declareEnd = "}" ; interfaces . declareMethodLeft = "public " ; interfaces . declareMethodMiddle = "(" ; interfaces . declareMethodRight = ")" ; interfaces . declareImplementsExplicit = true ; interfaces . methodTypeAfter = false ; interfaces . supported = true ; } param lambdas protected generateLambdaSyntax ( lambdas ) { lambdas . callLeft = ".apply(" ; lambdas . callRight = ")" ; lambdas . functionLeft = "(" ; lambdas . functionMiddle = ") -> " ; lambdas . functionRight = "" ; lambdas . parameterTypeRequired = false ; lambdas . returnTypeRequired = false ; } param typeInline protected generateLambdaTypeInlineSyntax ( typeInline ) { typeInline . includeParameterNames = false ; typeInline . leftByParameterCount = [ "Supplier<" , "Function<" , "BiFunction<" ] ; typeInline . middleWithoutParameters = "" ; typeInline . middleWithParameters = ", " ; typeInline . requiredImports = [ new Import ( [ "java" , "util" , "function" ] , [ "BiFunction" , "Function" , "Supplier" ] , ImportRelativity . Absolute ) , ] ; typeInline . right = ">" ; } param lists protected generateListSyntax ( lists ) { lists . addList = new NativeCallSyntax ( "addAll" , NativeCallScope . Member , NativeCallType . Function ) ; lists . className = "ArrayList" ; lists . getLeft = ".get(" ; lists . getRight = ")" ; lists . insert = new NativeCallSyntax ( "add" , NativeCallScope . Member , NativeCallType . Function ) ; lists . length = new NativeCallSyntax ( "size" , NativeCallScope . Member , NativeCallType . Function ) ; lists . pop = new NativeCallSyntax ( "remove" , NativeCallScope . Member , NativeCallType . Function ) . withArguments ( [ "{0}.size() - 1" ] ) ; lists . popFront = new NativeCallSyntax ( "remove" , NativeCallScope . Member , NativeCallType . Function ) . withArguments ( [ "0" ] ) ; lists . push = new NativeCallSyntax ( "add" , NativeCallScope . Member , NativeCallType . Function ) ; lists . requiredImports = [ new Import ( [ "java" , "util" ] , [ "ArrayList" ] , ImportRelativity . Absolute ) ] ; lists . setLeft = ".set(" ; lists . setMiddle = ", " ; lists . setRight = ")" ; lists . sortNumbers = new NativeCallSyntax ( "sort" , NativeCallScope . Member , NativeCallType . Function ) . withArguments ( [ "Comparator.naturalOrder()" ] ) . withImports ( [ new Import ( [ "java" , "util" ] , [ "Comparator" ] , ImportRelativity . Absolute ) ] ) ; lists . sortStrings = lists . sortNumbers ; } /**
     * Fills out metadata on list creation with items.
     */ protected generateListNewItemsSyntax ( newItems ) { newItems . itemLeft = "add(" ; newItems . itemRight = "); " ; newItems . left = "() {{ " ; newItems . right = "}}" ; } /**
     * Fills out metadata on fixed size list creation.
     */ protected generateListNewSizedSyntax ( newSized ) { newSized . includeType = true ; newSized . left = "new ArrayList<" ; newSized . middle = ">(" ; newSized . right = ")" ; } /**
     * Fills out metadata on list slicing.
     */ protected generateListSliceSyntax ( slices ) { slices . before = "new ArrayList<>(" ; slices . left = ".subList(" ; slices . middle = ", " ; slices . right = "))" ; slices . support = ListSliceSupport . Index ; slices . untilEndDefaultStart = "0" ; slices . untilEndLeft = ".subList(" ; slices . untilEndMiddle = ", " ; slices . untilEndRightFromIndex = "{0}.size()))" ; slices . untilEndRightFromStart = "{0}.size()))" ; } /**
     * Fills out metadata on list sorting by keyed member numbers.
     */ protected generateListSortMemberNumbersSyntax ( sortMembers ) { sortMembers . lambdaLeft = ".sort((" ; sortMembers . lambdaMiddleLeft = ") -> " ; sortMembers . lambdaMiddleRight = ".compareTo(" ; sortMembers . lambdaRight = "))" ; sortMembers . requiredImports = [ ] ; sortMembers . type = ListSortMemberType . KeyComparator ; } /**
     * Fills out metadata on list sorting by keyed member strings.
     */ protected generateListSortMemberStringsSyntax ( sortMembers ) { sortMembers . lambdaLeft = ".sort((" ; sortMembers . lambdaMiddleLeft = ") -> " ; sortMembers . lambdaMiddleRight = ".compareTo(" ; sortMembers . lambdaRight = "))" ; sortMembers . requiredImports = [ ] ; sortMembers . type = ListSortMemberType . KeyComparator ; } param loops protected generateLoopSyntax ( loops ) { loops . break = "break" ; loops . continue = "continue" ; loops . for = "for" ; loops . forEachEnd = "}" ; loops . forEachKeyEnd = "}" ; loops . forEachPairEnd = "}" ; loops . forNumbersEnd = "}" ; loops . whileStartLeft = "while" ; loops . whileStartMiddle = " (" ; loops . whileStartRight = ") {" ; loops . foreach = "for" ; loops . forEachGetKeys = ".keySet()" ; loops . forEachGetPairs = ".entrySet()" ; loops . forEachMiddle = " : " ; loops . forEachPairsAsPair = true ; loops . forEachPairsPairClass = "Map.Entry" ; loops . forEachPairsRetrieveKey = ".getKey()" ; loops . forEachPairsRetrieveValue = ".getValue()" ; loops . forEachPairsTypedPair = true ; loops . forEachRight = "" ; loops . forEachStartLeft = "for" ; loops . forEachStartIteration = " (" ; loops . forEachStartSeparator = " : " ; loops . forEachStartRight = ") {" ; } param main protected generateMainSyntax ( main ) { main . contextEndLines = [ "}" ] ; main . contextIndentation = 1 ; main . contextStartLines = [ "class {0} {" ] ; main . group = "{0}" ; main . mainEndLines = [ "}" ] ; main . mainIndentation = 1 ; main . mainStartLines = [ "public static void main(String[] args){1} {" ] ; } param math protected generateMathSyntax ( math ) { math . absolute = new NativeCallSyntax ( "Math.abs" , NativeCallScope . Static , NativeCallType . Function ) ; math . asInt = new NativeCallSyntax ( "(int)Math.floor" , NativeCallScope . Static , NativeCallType . Function ) ; math . ceiling = new NativeCallSyntax ( "Math.ceil" , NativeCallScope . Static , NativeCallType . Function ) ; math . floor = new NativeCallSyntax ( "Math.floor" , NativeCallScope . Static , NativeCallType . Function ) ; math . max = new NativeCallSyntax ( "Math.max" , NativeCallScope . Static , NativeCallType . Function ) ; math . min = new NativeCallSyntax ( "Math.min" , NativeCallScope . Static , NativeCallType . Function ) ; math . power = new NativeCallSyntax ( "Math.pow" , NativeCallScope . Static , NativeCallType . Function ) ; math . mathName = "Math" ; } param newProp protected generateNewSyntax ( newProp ) { newProp . instantiationKind = NewInstantiationSyntaxKind . Prefix ; newProp . keyword = "new" ; } param operators protected generateOperatorSyntax ( operators ) { operators . and = "&&" ; operators . decreaseBy = "-=" ; operators . divide = "/" ; operators . divideBy = "/=" ; operators . equals = "=" ; operators . equalTo = "==" ; operators . greaterThan = ">" ; operators . greaterThanOrEqualTo = ">=" ; operators . increaseBy = "+=" ; operators . lessThan = "<" ; operators . lessThanOrEqualTo = "<=" ; operators . minus = "-" ; operators . mod = "%" ; operators . multiplyBy = "*=" ; operators . not = "!" ; operators . notEqualTo = "!=" ; operators . or = "||" ; operators . plus = "+" ; operators . times = "*" ; } param parameters protected generateParameterSyntax ( parameters ) { parameters . restDeclarationAfter = false ; parameters . restDeclarationType = true ; parameters . restKeywordLeft = "" ; parameters . restKeywordMiddle = "... " ; parameters . restKeywordRight = "" ; } param parameters protected generatePrintingSyntax ( printing ) { printing . end = ")" ; printing . requiredImports = [ ] ; printing . start = "System.out.println(" ; } param parameters protected generateSetSyntax ( sets ) { sets . add = new NativeCallSyntax ( "add" , NativeCallScope . Member , NativeCallType . Function ) ; sets . className = "HashSet" ; sets . contains = new NativeCallSyntax ( "contains" , NativeCallScope . Member , NativeCallType . Function ) ; sets . initializeAsNew = true ; sets . initializeStart = "" ; sets . requiredImports = [ new Import ( [ "java" , "util" ] , [ "HashSet" ] , ImportRelativity . Absolute ) ] ; sets . startItemsLeft = "([" ; sets . startItemsRight = "])" ; sets . startNoItems = "()" ; sets . toArray = new NativeCallSyntax ( "toArray" , NativeCallScope . Member , NativeCallType . Function ) ; sets . toList = new NativeCallSyntax ( "new ArrayList<>" , NativeCallScope . Static , NativeCallType . Function ) ; sets . typeLeft = "<" ; sets . typeRight = ">" ; } param parameters protected generateStandaloneFunctionSyntax ( standaloneFunctions ) { standaloneFunctions . includeStaticKeyword = false ; standaloneFunctions . withinStaticClass = true ; } param strings protected generateStringFormatSyntax ( formatting ) { formatting . formatLeft = 'String.format("' ; formatting . formatMiddle = '", ' ; formatting . formatAbbreviated = '"' ; formatting . formatRight = ")" ; formatting . formatInputLeft = "" ; formatting . formatInputRight = "" ; formatting . includeIndexInFormatting = false ; formatting . inputTypes = true ; formatting . useInterpolation = false ; formatting . typeCodes = { char : "%c" , double : "%f" , int : "%d" , string : "%s" , } ; } param strings protected generateStringSyntax ( strings ) { strings . caseLower = new NativeCallSyntax ( "toLowerCase" , NativeCallScope . Member , NativeCallType . Function ) ; strings . caseUpper = new NativeCallSyntax ( "toUpperCase" , NativeCallScope . Member , NativeCallType . Function ) ; strings . className = "String" ; strings . concatenate = " + " ; strings . indexLeft = ".charAt(" ; strings . indexOf = new NativeCallSyntax ( "indexOf" , NativeCallScope . Member , NativeCallType . Function ) ; strings . indexOfNotFound = "-1" ; strings . indexRight = ")" ; strings . length = new NativeCallSyntax ( "length" , NativeCallScope . Member , NativeCallType . Function ) ; strings . trim = new NativeCallSyntax ( "trim" , NativeCallScope . Member , NativeCallType . Function ) ; } param strings protected generateStringSubstringSyntax ( substrings ) { substrings . defaultEnd = "" ; substrings . leftIndex = ".substring(" ; substrings . leftLength = ".substring(" ; substrings . middle = ", " ; substrings . right = ")" ; substrings . support = StringSubstringSupport . Index ; } param toDouble protected generateStringToDoubleSyntax ( toDouble ) { toDouble . conversionType = StringToNumberStartConversionType . PredeclareConvertAndValidate ; toDouble . initialVariableValues = "null" ; toDouble . initializeVariablesEnd = "\n\ntry {\n" ; toDouble . perVariableConversionStartLeft = "    " ; toDouble . perVariableConversionStartMiddle = " = Double.parseDouble(" ; toDouble . perVariableConversionStartRight = ");\n" ; toDouble . validationBlockComparison = "{1} != null" ; toDouble . validationBlockLeft = "} catch (NumberFormatException e) { }\n\nif (" ; toDouble . validationBlockMiddle = " && " ; toDouble . validationBlockRight = ") {" ; } param toInt protected generateStringToIntSyntax ( toInt ) { toInt . conversionType = StringToNumberStartConversionType . PredeclareConvertAndValidate ; toInt . initialVariableValues = "null" ; toInt . initializeVariablesEnd = "\n\ntry {\n" ; toInt . perVariableConversionStartLeft = "    " ; toInt . perVariableConversionStartMiddle = " = Integer.parseInt(" ; toInt . perVariableConversionStartRight = ");\n" ; toInt . validationBlockComparison = "{1} != null" ; toInt . validationBlockLeft = "} catch (NumberFormatException e) { }\n\nif (" ; toInt . validationBlockMiddle = " && " ; toInt . validationBlockRight = ") {" ; } param style protected generateStyleSyntax ( style ) { style . semicolon = ";" ; } param style protected generateUnsupportedSyntax ( unsupported ) { unsupported . complaintEnd = "*/" ; unsupported . complaintStart = "/*" ; } param variables protected generateVariableSyntax ( variables ) { variables . declarationRequired = true ; variables . aliases = { infinity : "Double.POSITIVE_INFINITY" , } ; variables . castLeft = "(" ; variables . castRight = ")" ; variables . declaration = "" ; variables . explicitTypes = true ; variables . null = "null" ; variables . isNotNullLeft = "" ; variables . isNotNullMiddle = " != " ; variables . isNullLeft = "" ; variables . isNullMiddle = " == " ; variables . nullRight = "null" ; } }