/** * Add superclasses to classes generated for inside structures, a structure * class will extend mapped class. * * @param mapClassNameToSuperclasses map with structure path as the key and * the interface name as value, it can be null. <b>Names of structures * should be in the lower case form amd dot separated for their hierarchy. * (example: "a.b.c")</b> * @return the builder instance, must not be null * @since 1.4.0 */ public Builder setMapSubClassesSuperclasses(final Map<String, String> mapClassNameToSuperclasses) { assertNonLocked(); this.mapSubClassesSuperclasses.clear(); if (mapClassNameToSuperclasses != null) { this.mapSubClassesSuperclasses.putAll(mapClassNameToSuperclasses); } return this; }
/** * Map inside structures to mainClassImplements, a structure class will * implement mapped interface and getter of the structure object will return * interface object as result. * * @param mapClassNameToInterface map with structure path as the key and the * interface name as value, it can be null. <b>Names of structures should be * in the lower case form amd dot separated for their hierarchy. (example: * "a.b.c")</b> * @return the builder instance, must not be null */ public Builder setMapSubClassesInterfaces(final Map<String, String> mapClassNameToInterface) { assertNonLocked(); this.mapSubClassesInterfaces.clear(); if (mapClassNameToInterface != null) { this.mapSubClassesInterfaces.putAll(mapClassNameToInterface); } return this; }
/** * Set interfaces to be added into 'implements' for the generated class. * * @param values interface names * @return the builder instance, must not be null */ public Builder setMainClassImplements(final String... values) { assertNonLocked(); Collections.addAll(this.mainClassImplements, values); return this; }
/** * Set the superclass for the main generated class. <b>NB! Also it affects * read and write methods of the main class, the class will be used as the * return type.</b> * * @param value the superclass name, it can be null * @return the builder instance, must not be null */ public Builder setSuperClass(final String value) { assertNonLocked(); this.superClass = value; return this; }
/** * The Name of the generated class. Must be provided. * * @param value the class name for the generated class, must not be null * @return the builder instance, must not be null */ public Builder setMainClassName(final String value) { assertNonLocked(); this.mainClassName = value; return this; }
/** * Set the package for the generated class. * * @param value name of the package, it can be empty or null in the case the * class will be in the default package * @return the builder instance, must not be null */ public Builder setMainClassPackage(final String value) { assertNonLocked(); this.mainClassPackage = value; return this; }
/** * Set commentaries placed just before first package directive of the * generated class. * * @param text text to be used as comment, it can be null * @return the builder instance, must not be null */ public Builder setHeadComment(final String text) { assertNonLocked(); this.headComment = text; return this; }
/** * Set the parser flags for the generated class, by default the flags are * imported from the base parser. * * @param value parser flags. * @return the builder instance, must not be null */ public Builder setParserFlags(final int value) { assertNonLocked(); this.parserFlags = value; return this; }
/** * Set flag to generate getters setters. <b>NB! All fields will be private * ones in the case.</b> * * @param value flag, if true then generate getters setters, false otherwise * @return the builder instance, must not be null */ public Builder setAddGettersSetters(final boolean value) { assertNonLocked(); this.addGettersSetters = value; return this; }
/** * Set custom text, the text will be added into the end of the result class. * * @param value text value, it can be null * @return the builder instance, must not be null */ public Builder setMainClassCustomText(final String value) { assertNonLocked(); this.mainClassCustomText = value; return this; }
/** * Don't make insternal generated classes as static ones * * @return the builder instance, must not be null * @since 1.4.0 */ public Builder doInternalClassesNonStatic() { assertNonLocked(); this.internalClassesNotStatic = true; return this; }
/** * Set flag to force abstract modifier for the generated class, by default * the class is abstract one only if it contains abstract methods. * * @param value true if to force the abstract modifier, false otherwise * @return the builder instance, must not be null */ public Builder setDoMainClassAbstract(final boolean value) { assertNonLocked(); this.doMainClassAbstract = value; return this; }