本文整理汇总了Java中org.mybatis.generator.api.dom.java.Field.setFinal方法的典型用法代码示例。如果您正苦于以下问题:Java Field.setFinal方法的具体用法?Java Field.setFinal怎么用?Java Field.setFinal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mybatis.generator.api.dom.java.Field
的用法示例。
在下文中一共展示了Field.setFinal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldClones
import org.mybatis.generator.api.dom.java.Field; //导入方法依赖的package包/类
/**
* Gets the field clones.
*
* @param commentGenerator
* the comment generator
* @param introspectedTable
* the introspected table
* @return the field clones
*/
public final List<Field> getFieldClones(CommentGenerator commentGenerator,
IntrospectedTable introspectedTable) {
configure();
List<Field> answer = new ArrayList<Field>();
for (Field oldField : fields) {
Field field = new Field();
field.setInitializationString(oldField.getInitializationString());
field.setFinal(oldField.isFinal());
field.setStatic(oldField.isStatic());
field.setName(oldField.getName());
field.setType(oldField.getType());
field.setVisibility(oldField.getVisibility());
commentGenerator.addFieldComment(field, introspectedTable);
answer.add(field);
}
return answer;
}
示例2: makeSerializable
import org.mybatis.generator.api.dom.java.Field; //导入方法依赖的package包/类
protected void makeSerializable(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable) {
if (addGWTInterface) {
topLevelClass.addImportedType(gwtSerializable);
topLevelClass.addSuperInterface(gwtSerializable);
}
if (!suppressJavaInterface) {
topLevelClass.addImportedType(serializable);
topLevelClass.addSuperInterface(serializable);
Field field = new Field();
field.setFinal(true);
field.setInitializationString("1L"); //$NON-NLS-1$
field.setName("serialVersionUID"); //$NON-NLS-1$
field.setStatic(true);
field.setType(new FullyQualifiedJavaType("long")); //$NON-NLS-1$
field.setVisibility(JavaVisibility.PRIVATE);
context.getCommentGenerator().addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
}
}
示例3: makeSerializable
import org.mybatis.generator.api.dom.java.Field; //导入方法依赖的package包/类
protected void makeSerializable(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable) {
if (addGWTInterface) {
topLevelClass.addImportedType(gwtSerializable);
topLevelClass.addSuperInterface(gwtSerializable);
}
if (!suppressJavaInterface) {
topLevelClass.addImportedType(serializable);
topLevelClass.addSuperInterface(serializable);
Field field = new Field();
field.setFinal(true);
field.setInitializationString("1L");
field.setName(SERIAL_VERSION_UID);
field.setStatic(true);
field.setType(new FullyQualifiedJavaType("long"));
field.setVisibility(JavaVisibility.PRIVATE);
context.getCommentGenerator().addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
}
}