Examples of Annotation


Examples of org.apache.harmony.unpack200.bytecode.AnnotationsAttribute.Annotation

        for (int j = 0; j < elementNames.length; j++) {
            elementNames[j] = (CPUTF8) namesIterator.next();
            int t = T[T_index++];
            elementValues[j] = new ElementValue(t, getNextValue(t));
        }
        return new Annotation(pairCount, type, elementNames, elementValues);
    }
View Full Code Here

Examples of org.apache.uima.annotator.regex.Annotation

            // create annotation object
            String id = annotationList[a].getId();
            String type = annotationList[a].getType();
            String validationClass = annotationList[a].getValidate();

            Annotation annotation = new Annotation_impl(id, type, begin, end,
                  validationClass);

            // read out feature values and add it to the annotation
            SetFeatureDocument.SetFeature[] features = annotationList[a]
                  .getSetFeatureArray();
            for (int f = 0; f < features.length; f++) {
               String name = features[f].getName();
               int featureType = features[f].getType().intValue();
               String value = features[f].getStringValue();
               int normalization = 0;
               if (features[f].getNormalization() != null) {
                  normalization = features[f].getNormalization().intValue();
               }
               String implClass = features[f].getClass1();

               Feature feature = new Feature_impl(featureType, name, value,
                     normalization, implClass);
               annotation.addFeature(feature);
            }
            // add annotation to rule
            concept.addAnnotation(annotation);
         }
         conceptList.add(concept);
View Full Code Here

Examples of org.apache.uima.jcas.tcas.Annotation

    for (Annotation annotation : annotationIndex) {
      // TODO be careful here, because some people inherit from DocumentAnnotation
      if (typeSystem.subsumes(docType, annotation.getType())) {
        continue;
      }
      Annotation clone = (Annotation) casCopier.copyFs(annotation);
      // change the view/sofa of the new annotation...
      // see: http://osdir.com/ml/apache.uima.general/2007-09/msg00107.html
      clone.setFeatureValue(modview.getTypeSystem()
              .getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFA), modview.getSofa());
      final int mappedBegin = map[clone.getBegin()];
      final int mappedEnd = map[clone.getEnd()];
      if (mappedBegin < mappedEnd) {
        if (mappedEnd > fromJcas.getCas().getDocumentAnnotation().getEnd()) {
          getContext().getLogger().log(Level.WARNING, "illegal annotation offset mapping");
        } else {
          int max = modview.getCas().getDocumentAnnotation().getEnd();
          if (mappedBegin < max && mappedEnd <= max && mappedBegin >= 0 && mappedEnd > 0) {
            clone.setBegin(mappedBegin);
            clone.setEnd(mappedEnd);
            // TODO handle nested annotation features
            modview.addFsToIndexes(clone);
            indexedFs.add(clone);
          } else {
            getContext().getLogger().log(Level.WARNING, "illegal annotation offset mapping");
View Full Code Here

Examples of org.apache.xmlbeans.impl.store.Splay.Annotation

                return false;
   
            if (!(bm._currentMark instanceof Annotation))
                return false;
   
            Annotation a = (Annotation) bm._currentMark;
   
            if (a.getRoot() != getRoot())
                return false;
   
            if (XmlBeans.ASSERTS)
                XmlBeans.assertTrue(a.getSplay() != null);

            set( a );
   
            return true;
        }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.annotation.Annotation

                    // the annotation is already there
                    unusedDecams.remove(decaM);
                    continue; // skip this one...
                  }
                 
                  Annotation a = decaM.getAnnotationX().getBcelAnnotation();
                  AnnotationGen ag = new AnnotationGen(a,clazz.getConstantPoolGen(),true);
                  Method oldMethod = mg.getMethod();
                  MethodGen myGen = new MethodGen(oldMethod,clazz.getClassName(),clazz.getConstantPoolGen());
                  myGen.addAnnotation(ag);
                  Method newMethod = myGen.getMethod();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation

      for (int index = 0; index < declaration.annotations.length; index++) {
        TypeDeclaration
            .resolveAnnotations(declaration.staticInitializerScope, declaration.annotations, declaration.binding); // force
        // annotation
        // resolution
        Annotation a = declaration.annotations[index];
        if (a.resolvedType == null) {
          continue; // another problem is being reported, so don't crash here
        }
        if (CharOperation.equals(a.resolvedType.signature(), aspectSig)) {
          return true;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation

    final int length = annotations.length;
    int visibleAnnotationsCounter = 0;
    int invisibleAnnotationsCounter = 0;
   
    for (int i = 0; i < length; i++) {
      Annotation annotation = annotations[i];
      if (isRuntimeInvisible(annotation)) {
        invisibleAnnotationsCounter++;
      } else if (isRuntimeVisible(annotation)) {
        visibleAnnotationsCounter++;
      }
    }

    if (invisibleAnnotationsCounter != 0) {
      int annotationAttributeOffset = contentsOffset;
      if (contentsOffset + 10 >= contents.length) {
        resizeContents(10);
      }
      int runtimeInvisibleAnnotationsAttributeNameIndex =
        constantPool.literalIndex(AttributeNamesConstants.RuntimeInvisibleAnnotationsName);
      contents[contentsOffset++] = (byte) (runtimeInvisibleAnnotationsAttributeNameIndex >> 8);
      contents[contentsOffset++] = (byte) runtimeInvisibleAnnotationsAttributeNameIndex;
      int attributeLengthOffset = contentsOffset;
      contentsOffset += 4; // leave space for the attribute length
 
      int annotationsLengthOffset = contentsOffset;
      contentsOffset += 2; // leave space for the annotations length
   
      contents[annotationsLengthOffset++] = (byte) (invisibleAnnotationsCounter >> 8);
      contents[annotationsLengthOffset++] = (byte) invisibleAnnotationsCounter;

      loop: for (int i = 0; i < length; i++) {
        if (invisibleAnnotationsCounter == 0) break loop;
        Annotation annotation = annotations[i];
        if (isRuntimeInvisible(annotation)) {
          generateAnnotation(annotation, annotationAttributeOffset);
          invisibleAnnotationsCounter--;
          if (this.contentsOffset == annotationAttributeOffset) {
            break loop;
          }
        }
      }
      if (contentsOffset != annotationAttributeOffset) {
        int attributeLength = contentsOffset - attributeLengthOffset - 4;
        contents[attributeLengthOffset++] = (byte) (attributeLength >> 24);
        contents[attributeLengthOffset++] = (byte) (attributeLength >> 16);
        contents[attributeLengthOffset++] = (byte) (attributeLength >> 8);
        contents[attributeLengthOffset++] = (byte) attributeLength;     
        attributesNumber++;
      } else {   
        contentsOffset = annotationAttributeOffset;
      }
    }
 
    if (visibleAnnotationsCounter != 0) {
      int annotationAttributeOffset = contentsOffset;
      if (contentsOffset + 10 >= contents.length) {
        resizeContents(10);
      }
      int runtimeVisibleAnnotationsAttributeNameIndex =
        constantPool.literalIndex(AttributeNamesConstants.RuntimeVisibleAnnotationsName);
      contents[contentsOffset++] = (byte) (runtimeVisibleAnnotationsAttributeNameIndex >> 8);
      contents[contentsOffset++] = (byte) runtimeVisibleAnnotationsAttributeNameIndex;
      int attributeLengthOffset = contentsOffset;
      contentsOffset += 4; // leave space for the attribute length
 
      int annotationsLengthOffset = contentsOffset;
      contentsOffset += 2; // leave space for the annotations length
   
      contents[annotationsLengthOffset++] = (byte) (visibleAnnotationsCounter >> 8);
      contents[annotationsLengthOffset++] = (byte) visibleAnnotationsCounter;

      loop: for (int i = 0; i < length; i++) {
        if (visibleAnnotationsCounter == 0) break loop;
        Annotation annotation = annotations[i];
        if (isRuntimeVisible(annotation)) {
          visibleAnnotationsCounter--;
          generateAnnotation(annotation, annotationAttributeOffset);
          if (this.contentsOffset == annotationAttributeOffset) {
            break loop;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation

    for (int i = 0; i < argumentsLength; i++) {
      Argument argument = arguments[i];
      Annotation[] annotations = argument.annotations;
      if (annotations != null) {
        for (int j = 0, max2 = annotations.length; j < max2; j++) {
          Annotation annotation = annotations[j];
          if (isRuntimeInvisible(annotation)) {
            annotationsCounters[i][INVISIBLE_INDEX]++;
            invisibleParametersAnnotationsCounter++;
          } else if (isRuntimeVisible(annotation)) {
            annotationsCounters[i][VISIBLE_INDEX]++;
            visibleParametersAnnotationsCounter++;
          }
        }
      }
    }
    int attributesNumber = 0;
    int annotationAttributeOffset = contentsOffset;
    if (invisibleParametersAnnotationsCounter != 0) {
      if (contentsOffset + 7 >= contents.length) {
        resizeContents(7);
      }
      int attributeNameIndex =
        constantPool.literalIndex(AttributeNamesConstants.RuntimeInvisibleParameterAnnotationsName);
      contents[contentsOffset++] = (byte) (attributeNameIndex >> 8);
      contents[contentsOffset++] = (byte) attributeNameIndex;
      int attributeLengthOffset = contentsOffset;
      contentsOffset += 4; // leave space for the attribute length

      contents[contentsOffset++] = (byte) argumentsLength;
      invisibleLoop: for (int i = 0; i < argumentsLength; i++) {
        if (contentsOffset + 2 >= contents.length) {
          resizeContents(2);
        }
        if (invisibleParametersAnnotationsCounter == 0) {
          contents[contentsOffset++] = (byte) 0;
          contents[contentsOffset++] = (byte) 0;         
        } else {
          final int numberOfInvisibleAnnotations = annotationsCounters[i][INVISIBLE_INDEX];
          contents[contentsOffset++] = (byte) (numberOfInvisibleAnnotations >> 8);
          contents[contentsOffset++] = (byte) numberOfInvisibleAnnotations;
          if (numberOfInvisibleAnnotations != 0) {
            Argument argument = arguments[i];
            Annotation[] annotations = argument.annotations;
            for (int j = 0, max = annotations.length; j < max; j++) {
              Annotation annotation = annotations[j];
              if (isRuntimeInvisible(annotation)) {
                generateAnnotation(annotation, annotationAttributeOffset);
                if (contentsOffset == annotationAttributeOffset) {
                  break invisibleLoop;
                }
                invisibleParametersAnnotationsCounter--;
              }
            }
          }
        }
      }
      if (contentsOffset != annotationAttributeOffset) {
        int attributeLength = contentsOffset - attributeLengthOffset - 4;
        contents[attributeLengthOffset++] = (byte) (attributeLength >> 24);
        contents[attributeLengthOffset++] = (byte) (attributeLength >> 16);
        contents[attributeLengthOffset++] = (byte) (attributeLength >> 8);
        contents[attributeLengthOffset++] = (byte) attributeLength;     
        attributesNumber++;
      } else {
        contentsOffset = annotationAttributeOffset;
      }
    }
    if (visibleParametersAnnotationsCounter != 0) {
      if (contentsOffset + 7 >= contents.length) {
        resizeContents(7);
      }
      int attributeNameIndex =
        constantPool.literalIndex(AttributeNamesConstants.RuntimeVisibleParameterAnnotationsName);
      contents[contentsOffset++] = (byte) (attributeNameIndex >> 8);
      contents[contentsOffset++] = (byte) attributeNameIndex;
      int attributeLengthOffset = contentsOffset;
      contentsOffset += 4; // leave space for the attribute length

      contents[contentsOffset++] = (byte) argumentsLength;
      visibleLoop: for (int i = 0; i < argumentsLength; i++) {
        if (contentsOffset + 2 >= contents.length) {
          resizeContents(2);
        }
        if (visibleParametersAnnotationsCounter == 0) {
          contents[contentsOffset++] = (byte) 0;
          contents[contentsOffset++] = (byte) 0;         
        } else {
          final int numberOfVisibleAnnotations = annotationsCounters[i][VISIBLE_INDEX];
          contents[contentsOffset++] = (byte) (numberOfVisibleAnnotations >> 8);
          contents[contentsOffset++] = (byte) numberOfVisibleAnnotations;
          if (numberOfVisibleAnnotations != 0) {
            Argument argument = arguments[i];
            Annotation[] annotations = argument.annotations;
            for (int j = 0, max = annotations.length; j < max; j++) {
              Annotation annotation = annotations[j];
              if (isRuntimeVisible(annotation)) {
                generateAnnotation(annotation, annotationAttributeOffset);
                if (contentsOffset == annotationAttributeOffset) {
                  break visibleLoop;
                }
View Full Code Here

Examples of org.biojava.bio.Annotation

     *
     * @return the definition of this {@link Term}.
     */
    public String getDefinition() {
      if (def == null) {
        Annotation annotation;
        Object definition;
        annotation = this.term.getAnnotation();
        definition = (annotation != null)
            && (annotation.keys().size() > 0) ? annotation
                .getProperty("def") : null;
                def = definition != null ? definition.toString() : "";
                def = def.replace("\\n", "\n").replace("\\t", "\t").replace("\\", "");
                def = def.trim();
      }
View Full Code Here

Examples of org.cipres.treebase.domain.Annotation

  public boolean isCharacterMatrix() { return true; }
 
  @Transient
  public List<Annotation> getAnnotations() {
    List<Annotation> annotations = super.getAnnotations();
    annotations.add(new Annotation(Constants.TBTermsURI,"tb:type.matrix",getDataType().getDescription()));
    annotations.add(new Annotation(Constants.TBTermsURI,"tb:ntax.matrix",getnTax()));
    annotations.add(new Annotation(Constants.TBTermsURI,"tb:nchar.matrix",getnChar()));
    annotations.add(new Annotation(Constants.TBTermsURI,"tb:identifier.matrix",getId()));
    return annotations;
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.