public void setDefaultValue(Object defaultValue) { MethodBinding originalMethod = original(); originalMethod.tagBits |= TagBits.DefaultValueResolved; AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) setAnnotations(null, null, defaultValue, null); else setAnnotations(holder.getAnnotations(), holder.getParameterAnnotations(), defaultValue, null); } public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations) {
static AnnotationHolder storeAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { if (parameterAnnotations != null) { boolean isEmpty = true; for (int i = parameterAnnotations.length; isEmpty && --i >= 0;) if (parameterAnnotations[i] != null && parameterAnnotations[i].length > 0) isEmpty = false; if (isEmpty) parameterAnnotations = null; // does not have any } if (defaultValue != null) return new AnnotationMethodHolder(annotations, parameterAnnotations, defaultValue, optionalEnv); if (parameterAnnotations != null) return new MethodHolder(annotations, parameterAnnotations); return new AnnotationHolder().setAnnotations(annotations); }
public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations) { AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) setAnnotations(null, parameterAnnotations, null, null); else setAnnotations(holder.getAnnotations(), parameterAnnotations, holder.getDefaultValue(), null); } protected final void setSelector(char[] selector) {
AnnotationHolder annotationHolder = binding.declaringClass.retrieveAnnotationHolder(binding, false); if (annotationHolder != null) { parameterAnnotationBindings = annotationHolder.getParameterAnnotations();
AnnotationBinding[] retrieveAnnotations(Binding binding) { AnnotationHolder holder = retrieveAnnotationHolder(binding, true); return holder == null ? Binding.NO_ANNOTATIONS : holder.getAnnotations(); }
public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue, optionalEnv)); } public void setDefaultValue(Object defaultValue) {
/** * @return the default value for this annotation method or <code>null</code> if there is no default value */ public Object getDefaultValue() { MethodBinding originalMethod = original(); if ((originalMethod.tagBits & TagBits.DefaultValueResolved) == 0) { //The method has not been resolved nor has its class been resolved. //It can only be from a source type within compilation units to process. if (originalMethod.declaringClass instanceof SourceTypeBinding) { SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass; if (sourceType.scope != null) { AbstractMethodDeclaration methodDeclaration = originalMethod.sourceMethod(); if (methodDeclaration != null && methodDeclaration.isAnnotationMethod()) { methodDeclaration.resolve(sourceType.scope); } } } originalMethod.tagBits |= TagBits.DefaultValueResolved; } AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); return holder == null ? null : holder.getDefaultValue(); }
AnnotationHolder annotationHolder = binding.declaringClass.retrieveAnnotationHolder(binding, false); if (annotationHolder != null) { parameterAnnotationBindings = annotationHolder.getParameterAnnotations();
AnnotationBinding[] retrieveAnnotations(Binding binding) { AnnotationHolder holder = retrieveAnnotationHolder(binding, true); return holder == null ? Binding.NO_ANNOTATIONS : holder.getAnnotations(); }
public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue, optionalEnv)); } public void setDefaultValue(Object defaultValue) {
/** * @return the default value for this annotation method or <code>null</code> if there is no default value */ public Object getDefaultValue() { MethodBinding originalMethod = original(); if ((originalMethod.tagBits & TagBits.DefaultValueResolved) == 0) { //The method has not been resolved nor has its class been resolved. //It can only be from a source type within compilation units to process. if (originalMethod.declaringClass instanceof SourceTypeBinding) { SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass; if (sourceType.scope != null) { AbstractMethodDeclaration methodDeclaration = originalMethod.sourceMethod(); if (methodDeclaration != null && methodDeclaration.isAnnotationMethod()) { methodDeclaration.resolve(sourceType.scope); } } } originalMethod.tagBits |= TagBits.DefaultValueResolved; } AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); return holder == null ? null : holder.getDefaultValue(); }
static AnnotationHolder storeAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { if (parameterAnnotations != null) { boolean isEmpty = true; for (int i = parameterAnnotations.length; isEmpty && --i >= 0;) if (parameterAnnotations[i] != null && parameterAnnotations[i].length > 0) isEmpty = false; if (isEmpty) parameterAnnotations = null; // does not have any } if (defaultValue != null) return new AnnotationMethodHolder(annotations, parameterAnnotations, defaultValue, optionalEnv); if (parameterAnnotations != null) return new MethodHolder(annotations, parameterAnnotations); return new AnnotationHolder().setAnnotations(annotations); }
public void setDefaultValue(Object defaultValue) { MethodBinding originalMethod = original(); originalMethod.tagBits |= TagBits.DefaultValueResolved; AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) setAnnotations(null, null, defaultValue, null); else setAnnotations(holder.getAnnotations(), holder.getParameterAnnotations(), defaultValue, null); } public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations) {
public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations) { AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) setAnnotations(null, parameterAnnotations, null, null); else setAnnotations(holder.getAnnotations(), parameterAnnotations, holder.getDefaultValue(), null); } protected final void setSelector(char[] selector) {
AnnotationHolder annotationHolder = binding.declaringClass.retrieveAnnotationHolder(binding, false); if (annotationHolder != null) { parameterAnnotationBindings = annotationHolder.getParameterAnnotations();
AnnotationBinding[] retrieveAnnotations(Binding binding) { AnnotationHolder holder = retrieveAnnotationHolder(binding, true); return holder == null ? Binding.NO_ANNOTATIONS : holder.getAnnotations(); }
public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue, optionalEnv)); } public void setDefaultValue(Object defaultValue) {
/** * @return the default value for this annotation method or <code>null</code> if there is no default value */ public Object getDefaultValue() { MethodBinding originalMethod = original(); if ((originalMethod.tagBits & TagBits.DefaultValueResolved) == 0) { //The method has not been resolved nor has its class been resolved. //It can only be from a source type within compilation units to process. if (originalMethod.declaringClass instanceof SourceTypeBinding) { SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass; if (sourceType.scope != null) { AbstractMethodDeclaration methodDeclaration = originalMethod.sourceMethod(); if (methodDeclaration != null && methodDeclaration.isAnnotationMethod()) { methodDeclaration.resolve(sourceType.scope); } } } originalMethod.tagBits |= TagBits.DefaultValueResolved; } AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); return holder == null ? null : holder.getDefaultValue(); }
static AnnotationHolder storeAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) { if (parameterAnnotations != null) { boolean isEmpty = true; for (int i = parameterAnnotations.length; isEmpty && --i >= 0;) if (parameterAnnotations[i] != null && parameterAnnotations[i].length > 0) isEmpty = false; if (isEmpty) parameterAnnotations = null; // does not have any } if (defaultValue != null) return new AnnotationMethodHolder(annotations, parameterAnnotations, defaultValue, optionalEnv); if (parameterAnnotations != null) return new MethodHolder(annotations, parameterAnnotations); return new AnnotationHolder().setAnnotations(annotations); }
public void setDefaultValue(Object defaultValue) { MethodBinding originalMethod = original(); originalMethod.tagBits |= TagBits.DefaultValueResolved; AnnotationHolder holder = this.declaringClass.retrieveAnnotationHolder(this, false); if (holder == null) setAnnotations(null, null, defaultValue, null); else setAnnotations(holder.getAnnotations(), holder.getParameterAnnotations(), defaultValue, null); } public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations) {