Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IAnnotation


   
    if (annoClass == null) {
      IAnnotation[] metas = typeOfAnnotation.getAnnotations();
      // might still be a meta annotation. Check for this.
      for (int ndx = 0; ndx < metas.length && annoClass == null; ndx++) {
        IAnnotation meta = metas[ndx];
       
        Pair<String,String> meta_name = getQualifiedAnnoType(meta, typeOfAnnotation);
        String meta_name_ = meta_name.fst() + "." + meta_name.snd();
       
        annoClass = metaQualNames.get(meta_name_);
View Full Code Here


   
    if (annoClass == null) {
      IAnnotation[] metas = typeOfAnnotation.getAnnotations();
      // might still be a meta annotation. Check for this.
      for (int ndx = 0; ndx < metas.length && annoClass == null; ndx++) {
        IAnnotation meta = metas[ndx];
       
        Pair<String,String> meta_name = getQualifiedAnnoType(meta, typeOfAnnotation);
        String meta_name_ = meta_name.fst() + "." + meta_name.snd();
       
        annoClass = metaQualNames.get(meta_name_);
View Full Code Here

      HashMap<String, Class> fieldss = new HashMap();

      for (Iterator<IType> i = types.iterator(); i.hasNext();) {
        IType r = i.next();
        IAnnotation ia = r.getAnnotation("Entity");
        if (ia != null && ia.exists()) {
          IField[] fields = r.getFields();
          for (IField f : fields) {
            IField sf = (IField) f;
            if (sf instanceof SourceField) {
              SourceField ssf = (SourceField) sf;
              String sigString = ssf.getTypeSignature();
              IAnnotation[] ias = sf.getAnnotations();
              if (ias == null || ias.length == 0 && true) {
                sigString = Signature.getTypeErasure(sigString);
                String simpleName = Signature
                    .toString(sigString);

                String name = sf.getElementName();
                if (isSupportedType(simpleName)) {
                  fieldss.put(name, getSupported(simpleName));
                } else {
                  fieldss.put(name, Blob.class);
                }

              }
            }
          }
        } else {
          IAnnotation ib = r.getAnnotation("PersistenceCapable");
          if (ib != null && ib.exists()) {
            IField[] fields = r.getFields();
            for (IField f : fields) {
              IField sf = (IField) f;
              if (sf instanceof SourceField) {
                SourceField ssf = (SourceField) sf;
                String sigString = ssf.getTypeSignature();
                IAnnotation iaf = sf
                    .getAnnotation("Persistent");
                IAnnotation iaPk = sf
                    .getAnnotation("PrimaryKey");
                if (iaf != null && iaf.exists()
                    && (iaPk == null || !iaPk.exists())) {
                  sigString = Signature
                      .getTypeErasure(sigString);
                  String simpleName = Signature
                      .toString(sigString);
View Full Code Here

      if (types != null) {
        for (Iterator<IType> i = types.iterator(); i.hasNext();) {
          IType r = i.next();
          IField[] fields = r.getFields();
          for (IField f : fields) {
            IAnnotation iaJDO = isJDO(f);
            IAnnotation iaJPA = isJPA(f);

            if ((iaJDO != null && iaJDO.exists())
                || (iaJPA != null && iaJPA.exists())) {

              if (f instanceof IField) {
                IField sf = (IField) f;
                String s = sf.getTypeSignature();
                String name = Signature.toString(s);
                String[] ss = Signature.getTypeArguments(s);
                if (ss.length == 1) {
                  name = Signature.toString(ss[0]);
                }
                String valName = sf.getElementName();
                ArrayList<String> pch = null;
                if (iaJDO != null && iaJDO.exists()) {
                  pch = getPossibleRelatedKinds(
                      name,
                      ijss,
                      JDO_PERSISTENT_ANNOTATIONS_FOR_TYPES
                          .toArray(new String[JDO_PERSISTENT_ANNOTATIONS_FOR_TYPES
                              .size()]));
                } else if (iaJPA != null && iaJPA.exists()) {
                  pch = getPossibleRelatedKinds(
                      name,
                      ijss,
                      JPA_PERSISTENT_ANNOTATIONS_FOR_TYPES
                          .toArray(new String[JPA_PERSISTENT_ANNOTATIONS_FOR_TYPES
View Full Code Here

          IField[] fields = r.getFields();
          for (IField f : fields) {

            String name = Signature.toString(f.getTypeSignature());

            IAnnotation emb = isFieldEmbedded(f);
            if (emb != null && emb.exists()) {
              findAllRelatedFields(embeddedTypes, isjdo, f, name,
                  null);
            }
          }
View Full Code Here

    }
    return null;
  }

  private HashMap<String, String> parseAnnotation(IField f, boolean isJdo) {
    IAnnotation emb = isFieldEmbedded(f);
    HashMap<String, String> elems = new HashMap();
    IAnnotation[] ias;
    if (isJdo) {
      try {
        ias = f.getAnnotations();
View Full Code Here

  }

  private IAnnotation isFieldEmbedded(IField t) {

    for (String s : EMBEDDED_ANNOTATIONS_FOR_FIELDS) {
      IAnnotation emb = t.getAnnotation(s);
      if (emb != null && emb.exists()) {
        return emb;
      }
    }
    return null;
  }
View Full Code Here

  }

  private boolean isJPA(IType t) {

    for (String s : JPA_PERSISTENT_ANNOTATIONS_FOR_TYPES) {
      IAnnotation iaJPA = t.getAnnotation(s);
      if (iaJPA != null && iaJPA.exists()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  }

  private boolean isJDO(IType t) {

    for (String s : JDO_PERSISTENT_ANNOTATIONS_FOR_TYPES) {
      IAnnotation iaJDO = t.getAnnotation(s);
      if (iaJDO != null && iaJDO.exists()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

      if (fields == null) {
        fields = new HashMap();
      }
      if (element instanceof IType) {
        IType rst = (IType) element;
        IAnnotation ia = null;
        ia = getAppropriateAnnotation(rst);
        if (ia != null && ia.exists()) {
          IField[] fields = rst.getFields();
          for (IField f : fields) {
            if (isCorrectField(f)) {
              int state = FieldInfo.COMPLETED;
              if (hasEmbeddedAnnotation(f)) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IAnnotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.