Creates a mapping result from supplied binary annotations.

@param binaryAnnotations binary annotations  of span
@return mapping result
966371
public MappingResult mappingResult(List<BinaryAnnotation> binaryAnnotations) {
        if (binaryAnnotations == null) {
            return new MappingResult();
        }

        List<String> componentTypes = new ArrayList<>();
        List<String> endpointTypes = new ArrayList<>();

        MappingResult.Builder mappingBuilder = MappingResult.builder();

        for (BinaryAnnotation binaryAnnotation: binaryAnnotations) {
            if (binaryAnnotation.getKey() == null) {
                continue;
            }

            BinaryAnnotationMapping mapping = mappingStorage.getKeyBasedMappings().get(binaryAnnotation.getKey());
            if (mapping != null && mapping.isIgnore()) {
                continue;
            }

            if (mapping == null || mapping.getProperty() == null) {
                // If no mapping, then just store property
                mappingBuilder.addProperty(new Property(binaryAnnotation.getKey(), binaryAnnotation.getValue(),
                        AnnotationTypeUtil.toPropertyType(binaryAnnotation.getType())));
            }

            if (mapping != null) {
                if (mapping.getComponentType() != null) {
                    componentTypes.add(mapping.getComponentType());
                }

                if (mapping.getEndpointType() != null) {
                    endpointTypes.add(mapping.getEndpointType());
                }

                if (mapping.getProperty() != null && !mapping.getProperty().isExclude()) {
                    String key = mapping.getProperty().getKey() != null ? mapping.getProperty().getKey() :
                            binaryAnnotation.getKey();
                    mappingBuilder.addProperty(new Property(key, binaryAnnotation.getValue(),
                            AnnotationTypeUtil.toPropertyType(binaryAnnotation.getType())));
                }
            }
        }

        if (!componentTypes.isEmpty()) {
            mappingBuilder.withComponentType(componentTypes.get(0));
        }
        if (!endpointTypes.isEmpty()) {
            mappingBuilder.withEndpointType(endpointTypes.get(0));
        }

        return mappingBuilder.build();
    }
846261
public static <T> Mapping<T> make(Class<T> clazz, boolean includeParentFields) {
        return new Mapping<T>(clazz, new DefaultAnnotationSet(), includeParentFields);
    }
810120
private String getAnnotations(final Properties properties,
      final String stringFromClient) throws IOException, JDOMException {

    BufferedReader breader;
    KAFDocument kaf;
    String kafString = null;
    String lang = properties.getProperty("language");
    String outputFormat = properties.getProperty("outputFormat");
    Boolean inputKafRaw = Boolean.valueOf(properties.getProperty("inputkaf"));
    Boolean noTok = Boolean.valueOf(properties.getProperty("notok"));
    String kafVersion = properties.getProperty("kafversion");
    Boolean offsets = Boolean.valueOf(properties.getProperty("offsets"));
    if (noTok) {
      final BufferedReader noTokReader = new BufferedReader(
          new StringReader(stringFromClient));
      kaf = new KAFDocument(lang, kafVersion);
      final KAFDocument.LinguisticProcessor newLp = kaf.addLinguisticProcessor(
          "text", "ixa-pipe-tok-notok-" + lang, version + "-" + commit);
      newLp.setBeginTimestamp();
      Annotate.tokensToKAF(noTokReader, kaf);
      newLp.setEndTimestamp();
      kafString = kaf.toString();
      noTokReader.close();
    } else {
      if (inputKafRaw) {
        final BufferedReader kafReader = new BufferedReader(
            new StringReader(stringFromClient));
        kaf = KAFDocument.createFromStream(kafReader);
        final String text = kaf.getRawText();
        final StringReader stringReader = new StringReader(text);
        breader = new BufferedReader(stringReader);
      } else {
        kaf = new KAFDocument(lang, kafVersion);
        breader = new BufferedReader(new StringReader(stringFromClient));
      }
      final Annotate annotator = new Annotate(breader, properties);
      if (outputFormat.equalsIgnoreCase("conll")) {
        if (offsets) {
          kafString = annotator.tokenizeToCoNLL();
        } else {
          kafString = annotator.tokenizeToCoNLLOffsets();
        }
      } else if (outputFormat.equalsIgnoreCase("oneline")) {
        kafString = annotator.tokenizeToText();
      } else {
        final KAFDocument.LinguisticProcessor newLp = kaf
            .addLinguisticProcessor("text", "ixa-pipe-tok-" + lang,
                version + "-" + commit);
        newLp.setBeginTimestamp();
        annotator.tokenizeToKAF(kaf);
        newLp.setEndTimestamp();
        kafString = kaf.toString();
      }
      breader.close();
    }
    return kafString;
  }
866111
static Map<ExecutableElement, AnnotationValue> getElementValues(AnnotationMirror annotation) {
    return Collections.<ExecutableElement, AnnotationValue>unmodifiableMap(
        annotation.getElementValues());
  }
1118676
protected List<Class<? extends Annotation>> createAnnotationTypeList(Class<?>... annotations) {
        final List<Class<? extends Annotation>> annotationList = new ArrayList<Class<? extends Annotation>>();
        for (Class<?> annoType : annotations) {
            @SuppressWarnings("unchecked")
            final Class<? extends Annotation> castType = (Class<? extends Annotation>) annoType;
            annotationList.add(castType);
        }
        return annotationList;
    }
329220
func annotateBinary(span *zipkincore.Span, key string, value interface{}, host *zipkincore.Endpoint) {
	if b, ok := value.(bool); ok {
		if b {
			value = "true"
		} else {
			value = "false"
		}
	}
	span.BinaryAnnotations = append(span.BinaryAnnotations, &zipkincore.BinaryAnnotation{
		Key:            key,
		Value:          []byte(fmt.Sprintf("%+v", value)),
		AnnotationType: zipkincore.AnnotationType_STRING,
		Host:           host,
	})
}
323293
public AnnotationValueBuilder<T> values(@Nullable String... strings) {
        return member(AnnotationMetadata.VALUE_MEMBER, strings);
    }
308746
public java.util.List<java.nio.ByteBuffer> getBinaryListValues() {
        if (binaryListValues == null) {
            binaryListValues = new com.amazonaws.internal.SdkInternalList<java.nio.ByteBuffer>();
        }
        return binaryListValues;
    }
542012
public static <A extends Annotation> AnnotationValues<A> createAnnotation(Class<A> type, final JavacNode node) {
		return createAnnotation(type, (JCAnnotation) node.get(), node);
	}
509781
public static ImmutableSet<? extends AnnotationMirror> getAnnotatedAnnotations(Element element,
      final Class<? extends Annotation> annotationType) {
    List<? extends AnnotationMirror> annotations = element.getAnnotationMirrors();
    return FluentIterable.from(annotations)
        .filter(new Predicate<AnnotationMirror>() {
          @Override public boolean apply(AnnotationMirror input) {
            return isAnnotationPresent(input.getAnnotationType().asElement(), annotationType);
          }
        })
        .toSet();
  }
1183379
public static function unserializeAnnotations($annotations)
    {
        $returnValue = array();

        
        $matches = array();
        $encoding = self::getApplicationHelper()->getDefaultEncoding();
        
        if (preg_match_all('/(#[\.\:,\|]{0,1}\s+(?:[^\\n]*))/', $annotations, $matches) !== false){
            if (isset($matches[1]) && count($matches[1]) > 0){
                foreach ($matches[1] as $match){
                    $match = trim($match);
                    $matchLen = mb_strlen($match, $encoding);
                    $annotationId = null;
                    $annotationValue = null;
                    
                    switch (mb_substr($match, 1, 1, $encoding)){
                        case "\t":
                        case ' ':
                            // Translator comment.
                            $annotationId = tao_helpers_translation_POTranslationUnit::TRANSLATOR_COMMENTS;
                            $annotationValue = mb_substr($match, 2, $matchLen - 2, $encoding);
                        break;
                        
                        case '.':
                            $annotationId = tao_helpers_translation_POTranslationUnit::EXTRACTED_COMMENTS;
                            $annotationValue = mb_substr($match, 3, $matchLen - 3, $encoding);
                        break;
                        
                        case ':':
                            $annotationId = tao_helpers_translation_POTranslationUnit::REFERENCE;
                            $annotationValue = mb_substr($match, 3, $matchLen - 3, $encoding);
                        break;
                        
                        case ',':
                            $annotationId = tao_helpers_translation_POTranslationUnit::FLAGS;
                            $annotationValue = mb_substr($match, 3, $matchLen - 3, $encoding);
                        break;
                        
                        case '|':
                            if (($pos = mb_strpos($match, 'msgid_plural', 0, $encoding)) !== false){
                                $pos += mb_strlen('msgid_plural', $encoding) + 1;
                                $annotationId = tao_helpers_translation_POTranslationUnit::PREVIOUS_MSGID_PLURAL;
                                $annotationValue = mb_substr($match, $pos, $matchLen - $pos, $encoding);
                            }
                            else if(($pos = mb_strpos($match, 'msgid', 0, $encoding)) !== false){
                                $pos += mb_strlen('msgid', $encoding) + 1;
                                $annotationId = tao_helpers_translation_POTranslationUnit::PREVIOUS_MSGID;
                                $annotationValue = mb_substr($match, $pos, $matchLen - $pos, $encoding);
                            }
                            else if(($pos = mb_strpos($match, 'msgctxt', 0, $encoding)) !== false){
                                $pos += mb_strlen('msgctxt', $encoding) + 1;
                                $annotationId = tao_helpers_translation_POTranslationUnit::PREVIOUS_MSGCTXT;
                                $annotationValue = mb_substr($match, $pos, $matchLen - $pos, $encoding);
                            }
                        break;
                    }
                    
                    if ($annotationId != null && $annotationValue != null){
                        if (!isset($returnValue[$annotationId])){
                            $returnValue[$annotationId] = $annotationValue;
                        }
                        else{
                            $returnValue[$annotationId] .= "\n${annotationValue}";
                        }
                    }
                }
            }
            
        }
        else{
            throw new tao_helpers_translation_TranslationException("An error occured while unserializing annotations '${annotations}'.");
        }
        

        return (array) $returnValue;
    }
865404
public <T> Mapping<T> getMapping(Class<T> clazz, boolean includeParentFields) {
        return getMapping(clazz, new DefaultAnnotationSet(), includeParentFields);
    }
820306
public AnnotationValueBuilder<T> values(@Nullable Enum<?>... enumObjs) {
        return member(AnnotationMetadata.VALUE_MEMBER, enumObjs);
    }
1278058
public Datatype.Builder addAllValueTypeAnnotations(Spliterator<? extends Excerpt> elements) {
    if ((elements.characteristics() & Spliterator.SIZED) != 0) {
      long elementsSize = elements.estimateSize();
      if (elementsSize > 0 && elementsSize <= Integer.MAX_VALUE) {
        if (valueTypeAnnotations instanceof ImmutableList) {
          valueTypeAnnotations = new ArrayList<>(valueTypeAnnotations);
        }
        ((ArrayList<?>) valueTypeAnnotations)
            .ensureCapacity(valueTypeAnnotations.size() + (int) elementsSize);
      }
    }
    elements.forEachRemaining(this::addValueTypeAnnotations);
    return (Datatype.Builder) this;
  }
963532
private ImmutableList<String> copyAnnotations(
      Element autoValueType, Element typeOrMethod, Set<String> excludedAnnotations) {
    ImmutableList<AnnotationMirror> annotationsToCopy =
        annotationsToCopy(autoValueType, typeOrMethod, excludedAnnotations);
    return annotationStrings(annotationsToCopy);
  }
294037
public String mapValidationAnnotation(String annotation, String defaultAnnotation) {
		String key = "validation.annotation." + toFirstUpper(annotation);
		if (hasProperty(key)) {
			return getProperty(key);
		} else {
			return defaultAnnotation;
		}
	}
1278838
public static AnnotationAttributes getAnnotationAttributes(Annotation annotation, boolean classValuesAsString,
			boolean nestedAnnotationsAsMap) {

		AnnotationAttributes attrs = new AnnotationAttributes();
		Method[] methods = annotation.annotationType().getDeclaredMethods();
		for (Method method : methods) {
			if (method.getParameterTypes().length == 0 && method.getReturnType() != void.class) {
				try {
					Object value = method.invoke(annotation);
					attrs.put(method.getName(), adaptValue(value, classValuesAsString, nestedAnnotationsAsMap));
				}
				catch (Exception ex) {
					throw new IllegalStateException("Could not obtain annotation attribute values", ex);
				}
			}
		}
		return attrs;
	}