List of usage examples for org.eclipse.jdt.internal.compiler.env IBinaryElementValuePair getName
char[] getName();
From source file:com.codenvy.ide.ext.java.server.internal.core.Annotation.java
License:Open Source License
public IMemberValuePair[] getMemberValuePairs() throws JavaModelException { Object info = getElementInfo(); if (info instanceof AnnotationInfo) return ((AnnotationInfo) info).members; IBinaryElementValuePair[] binaryAnnotations = ((IBinaryAnnotation) info).getElementValuePairs(); int length = binaryAnnotations.length; IMemberValuePair[] result = new IMemberValuePair[length]; for (int i = 0; i < length; i++) { IBinaryElementValuePair binaryAnnotation = binaryAnnotations[i]; MemberValuePair memberValuePair = new MemberValuePair(new String(binaryAnnotation.getName())); memberValuePair.value = Util.getAnnotationMemberValue(this, manager, memberValuePair, binaryAnnotation.getValue()); result[i] = memberValuePair;/*from www . jav a 2 s . c o m*/ } return result; }
From source file:com.codenvy.ide.ext.java.server.internal.core.search.indexing.BinaryIndexer.java
License:Open Source License
private void addBinaryAnnotation(IBinaryAnnotation annotation) { addAnnotationTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName()))); IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs(); if (valuePairs != null) { for (int j = 0, vpLength = valuePairs.length; j < vpLength; j++) { IBinaryElementValuePair valuePair = valuePairs[j]; addMethodReference(valuePair.getName(), 0); Object pairValue = valuePair.getValue(); addPairValue(pairValue);/*from w w w. j a va2 s .co m*/ } } }
From source file:org.eclipse.che.jdt.BinaryTypeConvector.java
License:Open Source License
private static JsonElement toJsonElementValuePair(IBinaryElementValuePair pair) { JsonObject object = new JsonObject(); object.add("name", pair.getName() == null ? JsonNull.INSTANCE : new JsonPrimitive(new String(pair.getName()))); object.add("value", toJsonDefaultValue(pair.getValue())); return object; }