Examples of TMethod


Examples of org.jboss.forge.scaffold.plugins.meta.model.TMethod

   public void addBeanField(String name, TClassType type)
   {
      classType.getFields().add(new TField(classType, name, type, Modifier.PRIVATE | Modifier.FINAL));

      TMethod getterMethod = new TMethod(classType, RenderUtil.getGetterName(type, name), type, Modifier.PUBLIC);
      getterMethod.setMethodContents("return this." + name + ";\n");
      classType.getMethods().add(getterMethod);

      TMethod setterMethod = new TMethod(classType, RenderUtil.getSetterName(name), type, Modifier.PUBLIC);
      setterMethod.addParameter(name, type, Modifier.FINAL);
      setterMethod.setMethodContents("this." + name + " = " + name + ";\n");
      classType.getMethods().add(setterMethod);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.