congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JDefinedClass.isAssignableFrom
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.haulmont.thirdparty/eclipselink

/**
 * Indicates if this <code>JavaClass</code> is either the same as, or is a superclass of,
 * the <code>javaClass</code> argument.
 *
 * @param javaClass the <code>Class</code> to test.
 *
 * @return <code>true</code> if this <code>JavaClass</code> is assignable from
 *         <code>javaClass</code>, otherwise <code>false</code>.
 *
 * @see java.lang.Class#isAssignableFrom(Class)
 */
public boolean isAssignableFrom(JavaClass javaClass) {
  if (javaClass == null) {
    return false;
  }
  XJCJavaClassImpl javaClassImpl = (XJCJavaClassImpl) javaClass;
  JClass someClass = javaClassImpl.xjcClass;
  return xjcClass.isAssignableFrom(someClass);
}
origin: com.github.jaxb-xew-plugin/jaxb-xew-plugin

/**
 * Remove method {@code ObjectFactory} that creates an object of a given {@code clazz}.
 * 
 * @return {@code 1} if such method was successfully located and removed
 */
private int deleteFactoryMethod(JDefinedClass factoryClass, Candidate candidate) {
  int deletedMethods = 0;
  for (Iterator<JMethod> iter = factoryClass.methods().iterator(); iter.hasNext();) {
    JMethod method = iter.next();
    // Remove the methods:
    // * public T createT() { return new T(); }
    // * public JAXBElement<T> createT(T value) { return new JAXBElement<T>(QNAME, T.class, null, value); }
    // * @XmlElementDecl(..., scope = X.class)
    //   public JAXBElement<T> createT...(T value) { return new JAXBElement<...>(QNAME, T.class, X.class, value); }
    if ((method.type() instanceof JDefinedClass
          && ((JDefinedClass) method.type()).isAssignableFrom(candidate.getClazz()))
          || isListedAsParametrisation(candidate.getClazz(), method.type())
          || candidate.getScopedElementInfos().containsKey(method.name())) {
      writeSummary("\tRemoving factory method [" + method.type().fullName() + "#" + method.name()
            + "()] from " + factoryClass.fullName());
      iter.remove();
      deletedMethods++;
    }
  }
  return deletedMethods;
}
origin: dmak/jaxb-xew-plugin

/**
 * Remove method {@code ObjectFactory} that creates an object of a given {@code clazz}.
 * 
 * @return {@code 1} if such method was successfully located and removed
 */
private int deleteFactoryMethod(JDefinedClass factoryClass, Candidate candidate) {
  int deletedMethods = 0;
  for (Iterator<JMethod> iter = factoryClass.methods().iterator(); iter.hasNext();) {
    JMethod method = iter.next();
    // Remove the methods:
    // * public T createT() { return new T(); }
    // * public JAXBElement<T> createT(T value) { return new JAXBElement<T>(QNAME, T.class, null, value); }
    // * @XmlElementDecl(..., scope = X.class)
    //   public JAXBElement<T> createT...(T value) { return new JAXBElement<...>(QNAME, T.class, X.class, value); }
    if ((method.type() instanceof JDefinedClass
          && ((JDefinedClass) method.type()).isAssignableFrom(candidate.getClazz()))
          || isListedAsParametrisation(candidate.getClazz(), method.type())
          || candidate.getScopedElementInfos().containsKey(method.name())) {
      writeSummary("\tRemoving factory method [" + method.type().fullName() + "#" + method.name()
            + "()] from " + factoryClass.fullName());
      iter.remove();
      deletedMethods++;
    }
  }
  return deletedMethods;
}
com.sun.codemodelJDefinedClassisAssignableFrom

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
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top plugins for WebStorm
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