Codota Logo
JDefinedClass.getConstructor
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain JDefinedClass
private void myMethod () {
JDefinedClass j =
  • Codota IconJCodeModel codeModel;String fullyqualifiedName;codeModel._class(fullyqualifiedName)
  • Codota IconJClassAlreadyExistsException e;e.getExistingClass()
  • Codota IconJCodeModel cm;String fullyqualifiedName;ClassType t;cm._class(fullyqualifiedName, t)
  • Smart code suggestions by Codota
}
origin: sabomichal/immutable-xjc

private JMethod addStandardConstructor(final JDefinedClass clazz, FieldOutline[] declaredFields, FieldOutline[] superclassFields) {
  JMethod ctor = clazz.getConstructor(NO_ARGS);
  if (ctor == null) {
    ctor = this.generateStandardConstructor(clazz, declaredFields, superclassFields);
  } else {
    this.log(Level.WARNING, "standardCtorExists");
  }
  return ctor;
}
origin: net.sourceforge.ccxjc/cc-xjc-plugin

private JMethod getStandardConstructor( final ClassOutline clazz )
{
  JMethod ctor = clazz.implClass.getConstructor( NO_ARGS );
  if ( ctor == null )
  {
    ctor = this.generateStandardConstructor( clazz );
  }
  else
  {
    this.log( Level.WARNING, "standardCtorExists", clazz.implClass.binaryName() );
  }
  return ctor;
}
origin: sabomichal/immutable-xjc

private Object addPropertyContructor(JDefinedClass clazz, FieldOutline[] declaredFields, FieldOutline[] superclassFields, int constAccess) {
  JMethod ctor = clazz.getConstructor(getFieldTypes(declaredFields, superclassFields));
  if (ctor == null) {
    ctor = this.generatePropertyConstructor(clazz, declaredFields, superclassFields, constAccess);
  } else {
    this.log(Level.WARNING, "standardCtorExists");
  }
  return ctor;
}
origin: net.sourceforge.ccxjc/cc-xjc-plugin

private JMethod getCopyConstructor( final ClassOutline clazz )
{
  JMethod ctor = clazz.implClass.getConstructor( new JType[]
    {
      clazz.implClass
    } );
  if ( ctor == null )
  {
    ctor = this.generateCopyConstructor( clazz );
  }
  else
  {
    this.log( Level.WARNING, "copyCtorExists", clazz.implClass.binaryName() );
  }
  return ctor;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Return the <code>JavaConstructor</code> for this <code>JavaClass</code> that has the
 * provided parameter types.
 *
 * @param parameterTypes the parameter list used to identify the constructor.
 *
 * @return the <code>JavaConstructor</code> with the signature matching parameterTypes.
 */
public JavaConstructor getConstructor(JavaClass[] parameterTypes) {
  JType[] xjcParameterTypes = new JType[parameterTypes.length];
  for (int i = 0; i < parameterTypes.length; i++) {
    JavaClass pType = parameterTypes[i];
    String className = pType.getQualifiedName();
    JType xjcType = null;
    if (pType.isPrimitive()) {
      xjcType = jPrimitiveTypes.get(className);
    } else {
      xjcType = jCodeModel._getClass(className);
    }
    xjcParameterTypes[i] = xjcType;
  }
  JMethod constructor = xjcClass.getConstructor(xjcParameterTypes);
  return new XJCJavaConstructorImpl(constructor, jCodeModel, dynamicClassLoader, this);
}
com.sun.codemodelJDefinedClassgetConstructor

Javadoc

Looks for a method that has the specified method signature and return it.

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

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JComboBox (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now