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

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

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

origin: com.haulmont.thirdparty/eclipselink

/**
 * Indicates if this <code>JavaClass</code> is <code>abstract</code>.
 *
 * @return <code>true</code> if this <code>JavaClass</code> is <code>abstract</code>, otherwise <code>false</code>.
 */
public boolean isAbstract() {
  return xjcClass.isAbstract();
}
origin: apache/cxf

public DefaultValueWriter createDefaultValueWriterForWrappedElement(QName wrapperElement, QName item) {
  if (defaultValues != null) {
    Mapping mapping = rawJaxbModelGenCode.get(wrapperElement);
    if (mapping != null) {
      List<? extends Property> propList = mapping.getWrapperStyleDrilldown();
      for (Property pro : propList) {
        if (pro.elementName().getNamespaceURI().equals(item.getNamespaceURI())
          && pro.elementName().getLocalPart().equals(item.getLocalPart())) {
          JType type = pro.type();
          if (type instanceof JDefinedClass
            && ((JDefinedClass)type).isAbstract()) {
            //no default values for abstract classes
            return null;
          }
          return new JAXBDefaultValueWriter(pro.type());
        }
      }
    }
  }
  return null;
}
origin: org.apache.cxf/cxf-tools-wsdlto-databinding-jaxb

public DefaultValueWriter createDefaultValueWriterForWrappedElement(QName wrapperElement, QName item) {
  if (defaultValues != null) {
    Mapping mapping = rawJaxbModelGenCode.get(wrapperElement);
    if (mapping != null) {
      List<? extends Property> propList = mapping.getWrapperStyleDrilldown();
      for (Property pro : propList) {
        if (pro.elementName().getNamespaceURI().equals(item.getNamespaceURI())
          && pro.elementName().getLocalPart().equals(item.getLocalPart())) {
          JType type = pro.type();
          if (type instanceof JDefinedClass
            && ((JDefinedClass)type).isAbstract()) {
            //no default values for abstract classes
            return null;
          }
          return new JAXBDefaultValueWriter(pro.type());
        }
      }
    }
  }
  return null;
}
origin: apache/cxf

    throw ex;
} else if (jdc.isAbstract()) {
  writer.write("null;");
} else {
origin: org.apache.cxf/cxf-tools-wsdlto-databinding-jaxb

    throw ex;
} else if (jdc.isAbstract()) {
  writer.write("null;");
} else {
origin: Evolveum/midpoint

private void createAsPrismObject(JDefinedClass definedClass) {
  JClass prismObjectClass = CLASS_MAP.get(PrismObject.class);
  JType returnType;
  if (definedClass.isAbstract()) {
    returnType = prismObjectClass.narrow(definedClass.wildcard());
  } else {
    // e.g. PrismObject<TaskType> for TaskType
    // we assume that we don't subclass a non-abstract object class into another one
    returnType = prismObjectClass.narrow(definedClass);
  }
  JMethod asPrismObject = definedClass.method(JMod.PUBLIC, returnType, METHOD_AS_PRISM_OBJECT);
  asPrismObject.annotate(CLASS_MAP.get(Override.class));
  //create method body
  JBlock body = asPrismObject.body();
  body._return(JExpr.invoke(METHOD_AS_PRISM_CONTAINER));
}
origin: mklemm/jaxb2-rich-contract-plugin

void generateDefaultConstructor() {
  final JMethod defaultConstructor = this.classOutline.implClass.constructor( this.classOutline.implClass.isAbstract() ? JMod.PROTECTED : JMod.PUBLIC);
  defaultConstructor.body().directStatement("// " + getMessage("defaultConstructor.bodyComment"));
  defaultConstructor.javadoc().append(getMessage("defaultConstructor.javadoc.desc"));
}
origin: apache/cxf

public DefaultValueWriter createDefaultValueWriter(QName qname, boolean element) {
  if (defaultValues == null) {
    return null;
  }
  TypeAndAnnotation typeAnno = rawJaxbModelGenCode.getJavaType(qname);
  if (element) {
    Mapping mapping = rawJaxbModelGenCode.get(qname);
    if (mapping != null) {
      typeAnno = mapping.getType();
    }
  }
  if (typeAnno != null && typeAnno.getTypeClass() instanceof JDefinedClass) {
    JDefinedClass dc = (JDefinedClass)typeAnno.getTypeClass();
    if (dc.isAbstract()) {
      //no default values for abstract classes
      typeAnno = null;
    }
  }
  if (typeAnno != null) {
    final JType type = typeAnno.getTypeClass();
    return new JAXBDefaultValueWriter(type);
  }
  return null;
}
origin: org.apache.cxf/cxf-tools-wsdlto-databinding-jaxb

public DefaultValueWriter createDefaultValueWriter(QName qname, boolean element) {
  if (defaultValues == null) {
    return null;
  }
  TypeAndAnnotation typeAnno = rawJaxbModelGenCode.getJavaType(qname);
  if (element) {
    Mapping mapping = rawJaxbModelGenCode.get(qname);
    if (mapping != null) {
      typeAnno = mapping.getType();
    }
  }
  if (typeAnno != null && typeAnno.getTypeClass() instanceof JDefinedClass) {
    JDefinedClass dc = (JDefinedClass)typeAnno.getTypeClass();
    if (dc.isAbstract()) {
      //no default values for abstract classes
      typeAnno = null;
    }
  }
  if (typeAnno != null) {
    final JType type = typeAnno.getTypeClass();
    return new JAXBDefaultValueWriter(type);
  }
  return null;
}
origin: org.apache.cxf/cxf-xjc-dv

private boolean containsDefaultValue(Outline outline, FieldOutline field) {
  ClassOutline fClass = null;
  for (ClassOutline classOutline : outline.getClasses()) {
    if (classOutline.implClass == field.getRawType() 
      && !classOutline.implClass.isAbstract()) {
      fClass = classOutline;
      break;
    }
  }
  if (fClass == null) {
    return false;
  }
  for (FieldOutline f : fClass.getDeclaredFields()) {
    if (f.getPropertyInfo().getSchemaComponent() instanceof XSParticle) {
      XSParticle particle = (XSParticle)f.getPropertyInfo().getSchemaComponent();
      XSTerm term = particle.getTerm();
      if (term.isElementDecl() && term.asElementDecl().getDefaultValue() != null) {
        return true;
      }
    }
  }
  return false;
}
origin: mklemm/jaxb2-rich-contract-plugin

JMethod generateNewCopyBuilderMethod(final boolean partial) {
  final JDefinedClass typeDefinition = this.typeOutline.isInterface() && ((DefinedInterfaceOutline)this.typeOutline).getSupportInterface() != null ? ((DefinedInterfaceOutline)this.typeOutline).getSupportInterface() : this.definedClass;
  final int mods = this.implement ? this.definedClass.isAbstract() ? JMod.PUBLIC | JMod.ABSTRACT : JMod.PUBLIC : JMod.NONE;
  final JMethod copyBuilderMethod = typeDefinition.method(mods, this.builderClass.raw, this.settings.getNewCopyBuilderMethodName());
  final JTypeVar copyBuilderMethodTypeParam = copyBuilderMethod.generify(BuilderGenerator.PARENT_BUILDER_TYPE_PARAMETER_NAME);
  final JVar parentBuilderParam = copyBuilderMethod.param(JMod.FINAL, copyBuilderMethodTypeParam, BuilderGenerator.PARENT_BUILDER_PARAM_NAME);
  final CopyGenerator copyGenerator = this.pluginContext.createCopyGenerator(copyBuilderMethod, partial);
  copyBuilderMethod.type(this.builderClass.raw.narrow(copyBuilderMethodTypeParam));
  final JMethod copyBuilderConvenienceMethod = typeDefinition.method(mods, this.builderClass.raw.narrow(this.pluginContext.voidClass), this.settings.getNewCopyBuilderMethodName());
  final CopyGenerator copyConvenienceGenerator = this.pluginContext.createCopyGenerator(copyBuilderConvenienceMethod, partial);
  if (this.implement && !this.definedClass.isAbstract()) {
    copyBuilderMethod.body()._return(copyGenerator.generatePartialArgs(this.pluginContext._new((JClass)copyBuilderMethod.type()).arg(parentBuilderParam).arg(JExpr._this()).arg(JExpr.TRUE)));
    copyBuilderConvenienceMethod.body()._return(copyConvenienceGenerator.generatePartialArgs(this.pluginContext.invoke(this.settings.getNewCopyBuilderMethodName()).arg(JExpr._null())));
  }
  if (this.typeOutline.getSuperClass() != null) {
    copyBuilderMethod.annotate(Override.class);
    copyBuilderConvenienceMethod.annotate(Override.class);
  }
  return copyBuilderMethod;
}
origin: mklemm/jaxb2-rich-contract-plugin

JMethod generateBuildMethod(final JMethod initMethod) {
  final JMethod buildMethod = this.builderClass.raw.method(JMod.PUBLIC, this.definedClass, this.settings.getBuildMethodName());
  if (!(this.builderClass.type._extends() == null || this.builderClass.type._extends().name().equals("java.lang.Object"))) {
    buildMethod.annotate(Override.class);
  }
  if (this.implement) {
    final JExpression buildExpression = JExpr._this().invoke(initMethod).arg(JExpr._new(this.definedClass));
    if (this.settings.isCopyAlways()) {
      buildMethod.body()._return(buildExpression);
    } else if (this.definedClass.isAbstract()) {
      buildMethod.body()._return(JExpr.cast(this.definedClass, this.storedValueField));
    } else {
      final JConditional jConditional = buildMethod.body()._if(this.storedValueField.eq(JExpr._null()));
      jConditional._then()._return(buildExpression);
      jConditional._else()._return(JExpr.cast(this.definedClass, this.storedValueField));
    }
  }
  return buildMethod;
}
origin: sabomichal/immutable-xjc

  if (!clazz.implClass.isAbstract()) {
    JDefinedClass builderClass;
    if ((builderClass = addBuilderClass(clazz, declaredFields, superclassFields)) == null) {
if (clazz.getSuperClass() != null) {
  clazz.getSuperClass().implClass.mods().setFinal(false);
} else if (clazz.implClass.isAbstract()) {
  clazz.implClass.mods().setFinal(false);
origin: mklemm/jaxb2-rich-contract-plugin

generateCopyToMethod(false);
generateNewCopyBuilderMethod(false);
if (this.implement && !this.definedClass.isAbstract()) {
  generateNewBuilderMethod();
  generateCopyOfMethod(this.typeOutline, false);
  generateCopyToMethod(true);
  generateNewCopyBuilderMethod(true);
  if (this.implement && !this.definedClass.isAbstract()) {
    final JMethod partialCopyOfMethod = generateCopyOfMethod(this.typeOutline, true);
    generateConveniencePartialCopyMethod(this.typeOutline, partialCopyOfMethod, this.pluginContext.copyExceptMethodName, this.pluginContext.excludeConst);
origin: mklemm/jaxb2-rich-contract-plugin

void generateCopyConstructor(final boolean partial) {
  final JDefinedClass definedClass = this.classOutline.implClass;
  final JMethod constructor = definedClass.constructor(definedClass.isAbstract() ? JMod.PROTECTED : JMod.PUBLIC);
  final JVar otherParam = constructor.param(JMod.FINAL, this.classOutline.implClass, DeepCopyGenerator.OTHER_PARAM_NAME);
  final CopyGenerator cloneGenerator = this.pluginContext.createCopyGenerator(constructor, partial);
  final JDocComment docComment = constructor.javadoc();
  docComment.append(getMessage("copyConstructor.javadoc.desc", definedClass.name()));
  docComment.addParam(otherParam).append(getMessage("copyConstructor.javadoc.param.other", definedClass.name()));
  if(partial) {
    docComment.addParam(cloneGenerator.getPropertyTreeParam()).append(getMessage("copyConstructor.javadoc.param.propertyPath", definedClass.name()));
    docComment.addParam(cloneGenerator.getPropertyTreeUseParam()).append(getMessage("copyConstructor.javadoc.param.propertyPathUse", definedClass.name()));
  }
  if (this.classOutline.getSuperClass() != null) {
    constructor.body().add(cloneGenerator.generatePartialArgs(this.pluginContext._super().arg(otherParam)));
  }
  final JBlock body = constructor.body();
  generateFieldCopyExpressions(cloneGenerator, body, JExpr._this(), otherParam);
}
origin: mklemm/jaxb2-rich-contract-plugin

final void generateCopyConstructor(final boolean partial) {
  final JMethod constructor = this.builderClass.raw.constructor(this.builderClass.raw.isAbstract() ? JMod.PROTECTED : JMod.PUBLIC);
  final JVar parentBuilderParam = constructor.param(JMod.FINAL, this.builderClass.typeParam, BuilderGenerator.PARENT_BUILDER_PARAM_NAME);
  final JVar otherParam = constructor.param(JMod.FINAL, this.typeOutline.getImplClass(), BuilderGenerator.OTHER_PARAM_NAME);
  final JVar copyParam = constructor.param(JMod.FINAL, this.pluginContext.codeModel.BOOLEAN, BuilderGenerator.COPY_FLAG_PARAM_NAME);
  final CopyGenerator cloneGenerator = this.pluginContext.createCopyGenerator(constructor, partial);
  if (this.typeOutline.getSuperClass() != null) {
    constructor.body().add(cloneGenerator.generatePartialArgs(this.pluginContext._super().arg(parentBuilderParam).arg(otherParam).arg(copyParam)));
  } else {
    constructor.body().assign(JExpr._this().ref(this.parentBuilderField), parentBuilderParam);
  }
  final JConditional ifNullStmt = constructor.body()._if(otherParam.ne(JExpr._null()));
  final JBlock body;
  if (!this.settings.isCopyAlways() && this.typeOutline.getSuperClass() == null) {
    final JConditional ifCopyStmt = ifNullStmt._then()._if(copyParam);
    ifCopyStmt._else().assign(this.storedValueField, otherParam);
    ifNullStmt._else().assign(this.storedValueField, JExpr._null());
    body = ifCopyStmt._then();
    body.assign(this.storedValueField, JExpr._null());
  } else {
    body = ifNullStmt._then();
  }
  generateFieldCopyExpressions(cloneGenerator, body, JExpr._this(), otherParam);
}
origin: Evolveum/midpoint

JBlock body = cloneMethod.body();
if (impl.isAbstract()) {
  body._return(JExpr._this());
com.sun.codemodelJDefinedClassisAbstract

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

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top plugins for Android Studio
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