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, memberValuePair, binaryAnnotation.getValue()); result[i] = memberValuePair; } return result; }
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, memberValuePair, binaryAnnotation.getValue()); result[i] = memberValuePair; } return result; }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env.createUnresolvedAnnotation(annotationType, pairs); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env.createUnresolvedAnnotation(annotationType, pairs); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env.createUnresolvedAnnotation(annotationType, pairs); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return new UnresolvedAnnotationBinding(annotationType, pairs, env); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env.createUnresolvedAnnotation(annotationType, pairs); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return new UnresolvedAnnotationBinding(annotationType, pairs, env); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env.createUnresolvedAnnotation(annotationType, pairs); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env.createUnresolvedAnnotation(annotationType, pairs); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames), null); char[] typeName = annotationInfo.getTypeName(); ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return new UnresolvedAnnotationBinding(annotationType, pairs, env); }
static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); int length = binaryPairs == null ? 0 : binaryPairs.length; ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null); char[] typeName = annotationInfo.getTypeName(); LookupEnvironment env2 = annotationInfo.isExternalAnnotation() ? env.root : env; ReferenceBinding annotationType = env2.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); return env2.createUnresolvedAnnotation(annotationType, pairs); }
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); } } } private void addPairValue(Object pairValue) {
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); } } } private void addPairValue(Object pairValue) {
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); } } } private void addPairValue(Object pairValue) {
private void initAnnotation(NdAnnotation annotation, IBinaryAnnotation next) { annotation.setType(createTypeIdFromBinaryName(next.getTypeName())); IBinaryElementValuePair[] pairs = next.getElementValuePairs(); if (pairs != null) { annotation.allocateValuePairs(pairs.length); for (IBinaryElementValuePair element : pairs) { NdAnnotationValuePair nextPair = annotation.createValuePair(element.getName()); nextPair.setValue(createConstantFromMixedType(element.getValue())); } } }
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); } } } private void addPairValue(Object pairValue) {
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); } } } private void addPairValue(Object pairValue) {
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); } } } private void addPairValue(Object pairValue) {
private void initAnnotation(NdAnnotation annotation, IBinaryAnnotation next) { annotation.setType(createTypeIdFromBinaryName(next.getTypeName())); IBinaryElementValuePair[] pairs = next.getElementValuePairs(); if (pairs != null) { annotation.allocateValuePairs(pairs.length); for (IBinaryElementValuePair element : pairs) { NdAnnotationValuePair nextPair = annotation.createValuePair(element.getName()); nextPair.setValue(createConstantFromMixedType(element.getValue())); } } }