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

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

Best Java code snippets using com.sun.codemodel.JDefinedClass.annotations (Showing top 4 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: org.glassfish.metro/webservices-tools

public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) {
  for( ClassOutline co : model.getClasses() ) {
    Iterator<JAnnotationUse> ann = co.ref.annotations().iterator();
    while (ann.hasNext()) {
      try {
        JAnnotationUse a = ann.next();
        Field clazzField = a.getClass().getDeclaredField("clazz");
        clazzField.setAccessible(true);
        JClass cl = (JClass) clazzField.get(a);
        if (cl.equals(model.getCodeModel()._ref(XmlAccessorType.class))) {
          a.param("value", XmlAccessType.PROPERTY);
          break;
        }
      } catch (IllegalArgumentException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (IllegalAccessException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (NoSuchFieldException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (SecurityException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
  }        
  return true;
}

origin: apache/servicemix-bundles

public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) {
  for( ClassOutline co : model.getClasses() ) {
    Iterator<JAnnotationUse> ann = co.ref.annotations().iterator();
    while (ann.hasNext()) {
      try {
        JAnnotationUse a = ann.next();
        Field clazzField = a.getClass().getDeclaredField("clazz");
        clazzField.setAccessible(true);
        JClass cl = (JClass) clazzField.get(a);
        if (cl.equals(model.getCodeModel()._ref(XmlAccessorType.class))) {
          a.param("value", XmlAccessType.PROPERTY);
          break;
        }
      } catch (IllegalArgumentException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (IllegalAccessException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (NoSuchFieldException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (SecurityException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
  }        
  return true;
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc

public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) {
  for( ClassOutline co : model.getClasses() ) {
    Iterator<JAnnotationUse> ann = co.ref.annotations().iterator();
    while (ann.hasNext()) {
      try {
        JAnnotationUse a = ann.next();
        Field clazzField = a.getClass().getDeclaredField("clazz");
        clazzField.setAccessible(true);
        JClass cl = (JClass) clazzField.get(a);
        if (cl.equals(model.getCodeModel()._ref(XmlAccessorType.class))) {
          a.param("value", XmlAccessType.PROPERTY);
          break;
        }
      } catch (IllegalArgumentException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (IllegalAccessException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (NoSuchFieldException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      } catch (SecurityException ex) {
        Logger.getLogger(PluginImpl.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
  }        
  return true;
}

origin: com.tomitribe.tribestream/tribestream-xjc

  @Override
  protected void onClass(final ClassOutline classOutline) {
    String namespace = null;
    for (final JAnnotationUse annot : classOutline.implClass.annotations()) {
      final String fullName = annot.getAnnotationClass().fullName();
      if (xmlTypeName.equals(fullName)) {
        final JAnnotationValue value = annot.getAnnotationMembers().get("namespace");
        if (value != null) {
          final StringWriter w = new StringWriter();
          value.generate(new JFormatter(w));
          namespace = w.toString();
          namespace = namespace.substring(1, namespace.length() - 1); // remove quotes
        }
      } else if (xmlRootEltName.equals(fullName)) {
        namespace = null;
        break;
      }
    }
    if (null == namespace) {
      return;
    }
    classOutline.implClass.annotate(XmlRootElement.class)
        .param("namespace", namespace)
        .param("name", toXml(classOutline.implClass.name()));
  }
}
com.sun.codemodelJDefinedClassannotations

Javadoc

Annotations on this variable. Lazily created.

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
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
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