Tabnine Logo
JDefinedClass.removeField
Code IndexAdd Tabnine to your IDE (free)

How to use
removeField
method
in
com.sun.codemodel.JDefinedClass

Best Java code snippets using com.sun.codemodel.JDefinedClass.removeField (Showing top 9 results out of 315)

origin: stackoverflow.com

jdc.removeField(field);
jdc.field(JMod.PRIVATE, field.type(), field.name());
origin: stackoverflow.com

jdc.removeField(field);
jdc.field(JMod.PRIVATE, field.type(), field.name());
origin: Evolveum/midpoint

private void updateObjectReferenceResolutionTime(JDefinedClass definedClass, JMethod getReference) {
  JFieldVar typeField = definedClass.fields().get("resolutionTime");
  JMethod getType = recreateMethod(findMethod(definedClass, "getResolutionTime"), definedClass);
  copyAnnotations(getType, typeField);
  JBlock body = getType.body();
  body._return(JExpr.invoke(JExpr.invoke(getReference), "getResolutionTime"));
  definedClass.removeField(typeField);
  JMethod setType = recreateMethod(findMethod(definedClass, "setResolutionTime"), definedClass);
  body = setType.body();
  JInvocation invocation = body.invoke(JExpr.invoke(getReference), "setResolutionTime");
  invocation.arg(setType.listParams()[0]);
}
origin: Evolveum/midpoint

private void updateObjectReferenceRelation(JDefinedClass definedClass, JMethod getReference) {
  JFieldVar typeField = definedClass.fields().get("relation");
  JMethod getType = recreateMethod(findMethod(definedClass, "getRelation"), definedClass);
  copyAnnotations(getType, typeField);
  JBlock body = getType.body();
  body._return(JExpr.invoke(JExpr.invoke(getReference), "getRelation"));
  definedClass.removeField(typeField);
  JMethod setType = recreateMethod(findMethod(definedClass, "setRelation"), definedClass);
  body = setType.body();
  JInvocation invocation = body.invoke(JExpr.invoke(getReference), "setRelation");
  invocation.arg(setType.listParams()[0]);
}
origin: Evolveum/midpoint

private void updateObjectReferenceOid(JDefinedClass definedClass, JMethod getReference) {
  JFieldVar oidField = definedClass.fields().get("oid");
  JMethod getOid = recreateMethod(findMethod(definedClass, "getOid"), definedClass);
  copyAnnotations(getOid, oidField);
  definedClass.removeField(oidField);
  JBlock body = getOid.body();
  body._return(JExpr.invoke(JExpr.invoke(getReference), getOid.name()));
  JMethod setOid = recreateMethod(findMethod(definedClass, "setOid"), definedClass);
  body = setOid.body();
  JInvocation invocation = body.invoke(JExpr.invoke(getReference), setOid.name());
  invocation.arg(setOid.listParams()[0]);
}
origin: Evolveum/midpoint

private void updateObjectReferenceDescription(JDefinedClass definedClass, JMethod getReference) {
  JFieldVar descriptionField = definedClass.fields().get("description");
  JMethod getDescription = recreateMethod(findMethod(definedClass, "getDescription"), definedClass);
  copyAnnotations(getDescription, descriptionField);
  definedClass.removeField(descriptionField);
  JBlock body = getDescription.body();
  body._return(JExpr.invoke(JExpr.invoke(getReference), getDescription.name()));
  JMethod setDescription = recreateMethod(findMethod(definedClass, "setDescription"), definedClass);
  body = setDescription.body();
  JInvocation invocation = body.invoke(JExpr.invoke(getReference), setDescription.name());
  invocation.arg(setDescription.listParams()[0]);
}
origin: Evolveum/midpoint

private void updateObjectReferenceFilter(JDefinedClass definedClass, JMethod asReferenceValue) {
  JFieldVar filterField = definedClass.fields().get("filter");
  JMethod getFilter = recreateMethod(findMethod(definedClass, "getFilter"), definedClass);
  copyAnnotations(getFilter, filterField);
  definedClass.removeField(filterField);
  JBlock body = getFilter.body();
  JType innerFilterType = getFilter.type();
  JVar filterClassVar = body.decl(innerFilterType, "filter", JExpr._new(innerFilterType));
  JInvocation getFilterElementInvocation =CLASS_MAP.get(PrismForJAXBUtil.class).staticInvoke(METHOD_PRISM_UTIL_GET_REFERENCE_FILTER_CLAUSE_XNODE);
  getFilterElementInvocation.arg(JExpr.invoke(asReferenceValue));
  JInvocation setFilterInvocation = body.invoke(filterClassVar, "setFilterClauseXNode");
  setFilterInvocation.arg(getFilterElementInvocation);
  body._return(filterClassVar);
  JMethod setFilter = recreateMethod(findMethod(definedClass, "setFilter"), definedClass);
  body = setFilter.body();
  JInvocation invocation = CLASS_MAP.get(PrismForJAXBUtil.class).staticInvoke(METHOD_PRISM_UTIL_SET_REFERENCE_FILTER_CLAUSE_XNODE);
  invocation.arg(JExpr.invoke(asReferenceValue));
  invocation.arg(setFilter.listParams()[0]);
  body.add(invocation);
}
origin: Evolveum/midpoint

private void updateObjectReferenceType(JDefinedClass definedClass, JMethod getReference) {
  JFieldVar typeField = definedClass.fields().get("type");
  JMethod getType = recreateMethod(findMethod(definedClass, "getType"), definedClass);
  copyAnnotations(getType, typeField);
  JBlock body = getType.body();
  body._return(JExpr.invoke(JExpr.invoke(getReference), "getTargetType"));
  definedClass.removeField(typeField);
  JMethod setType = recreateMethod(findMethod(definedClass, "setType"), definedClass);
  body = setType.body();
  JInvocation invocation = body.invoke(JExpr.invoke(getReference), "setTargetType");
  invocation.arg(setType.listParams()[0]);
  invocation.arg(JExpr.lit(true));
  JFieldVar targetNameField = definedClass.fields().get("targetName");
  JMethod getTargetName = recreateMethod(findMethod(definedClass, "getTargetName"), definedClass);
  copyAnnotations(getTargetName, targetNameField);
  JBlock getTargetNamebody = getTargetName.body();
  JInvocation getTargetNameInvocation = CLASS_MAP.get(PrismForJAXBUtil.class).staticInvoke(METHOD_PRISM_UTIL_GET_REFERENCE_TARGET_NAME);
  getTargetNameInvocation.arg(JExpr.invoke(getReference));
  getTargetNamebody._return(getTargetNameInvocation);
  definedClass.removeField(targetNameField);
  JMethod setTargetName = recreateMethod(findMethod(definedClass, "setTargetName"), definedClass);
  JBlock setTargetNamebody = setTargetName.body();
  JInvocation setTagetNameInvocation = setTargetNamebody.staticInvoke(CLASS_MAP.get(PrismForJAXBUtil.class), METHOD_PRISM_UTIL_SET_REFERENCE_TARGET_NAME);
  setTagetNameInvocation.arg(JExpr.invoke(getReference));
  setTagetNameInvocation.arg(setTargetName.listParams()[0]);
}
origin: org.apache.cxf/cxf-xjc-dv

JFieldVar var = co.implClass.fields().get(varName);
if (var != null) {
  co.implClass.removeField(var);
com.sun.codemodelJDefinedClassremoveField

Javadoc

Removes a JFieldVar from this class.

Popular methods of JDefinedClass

  • method
  • _extends
  • field
  • _implements
  • name
    JClass name accessor. For example, for java.util.List, this method returns "List""
  • constructor
    Adds a constructor to this class.
  • fields
    Returns all the fields declred in this class. The returned Map is a read-only live view.
  • annotate
    Adding ability to annotate a class
  • fullName
    Gets the fully qualified name of this class.
  • methods
  • owner
  • javadoc
    Creates, if necessary, and returns the class javadoc for this JDefinedClass
  • owner,
  • javadoc,
  • _class,
  • getMethod,
  • _package,
  • dotclass,
  • enumConstant,
  • staticInvoke,
  • staticRef,
  • init

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • ImageIO (javax.imageio)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now