Lines Matching defs:value

32  * It consists of name and value, supplemented with element
34 * <br>The value may be one of the following types:
43 * The last type is specific for this implementation; a Throwable value
46 * is requested for value.
57 * Tag description of a Throwable value type.
62 * Tag description of an array value type.
67 * Tag description of all value types except arrays and Throwables.
86 * Singleton representing missing element value.
91 protected final Object value; // a primitive value is wrapped to the corresponding wrapper class
99 * Creates a new element with specified name and value.
103 * @param val element value, should be of addmissible type,
110 value = val == null ? NO_VALUE : val;
111 if (value instanceof Throwable) {
113 } else if (value.getClass().isArray()) {
123 * @param value element value, should be of addmissible type,
165 * Returns readable description of this annotation value.
171 int len = Array.getLength(value);
174 sb.append(Array.get(value, i));
178 return name+ "=" +value;
184 * (equivalent name-value pair).
185 * <br> A special case is the contained Throwable value; it is considered
202 return equalArrayValue(that.value);
204 // undefined value is incomparable (transcendent)
207 return value.equals(that.value);
215 * Returns true if the contained value and a passed object are equal arrays,
219 * @return true if the value is array and is equal to specified object,
223 if (value instanceof Object[] && otherValue instanceof Object[]) {
224 return Arrays.equals((Object[])value, (Object[])otherValue);
226 Class type = value.getClass();
231 return Arrays.equals((int[])value, (int[])otherValue);
233 return Arrays.equals((byte[])value, (byte[])otherValue);
235 return Arrays.equals((short[])value, (short[])otherValue);
237 return Arrays.equals((long[])value, (long[])otherValue);
239 return Arrays.equals((char[])value, (char[])otherValue);
241 return Arrays.equals((boolean[])value, (boolean[])otherValue);
243 return Arrays.equals((float[])value, (float[])otherValue);
245 return Arrays.equals((double[])value, (double[])otherValue);
252 * <code> (name.hashCode() * 127) ^ value.hashCode() </code>
253 * <br>If value is an array, one of overloaded Arrays.hashCode()
262 Class type = value.getClass();
264 return hash ^ Arrays.hashCode((int[])value);
266 return hash ^ Arrays.hashCode((byte[])value);
268 return hash ^ Arrays.hashCode((short[])value);
270 return hash ^ Arrays.hashCode((long[])value);
272 return hash ^ Arrays.hashCode((char[])value);
274 return hash ^ Arrays.hashCode((boolean[])value);
276 return hash ^ Arrays.hashCode((float[])value);
278 return hash ^ Arrays.hashCode((double[])value);
280 return hash ^ Arrays.hashCode((Object[])value);
282 return hash ^ value.hashCode();
296 if (value instanceof TypeNotPresentException) {
297 TypeNotPresentException tnpe = (TypeNotPresentException)value;
299 } else if (value instanceof EnumConstantNotPresentException) {
300 EnumConstantNotPresentException ecnpe = (EnumConstantNotPresentException)value;
302 } else if (value instanceof ArrayStoreException) {
303 ArrayStoreException ase = (ArrayStoreException)value;
308 Throwable error = (Throwable)value;
327 * Validates contained value against its member definition
328 * and if ok returns the value.
329 * Otherwise, if the value type mismatches definition
330 * or the value itself describes an error,
333 * with such value.
337 * @return actual valid value or null if no value
343 if (value == NO_VALUE) {
346 if (elementType == value.getClass()
347 || elementType.isInstance(value)) { // nested annotation value
351 value.getClass().getName());
358 * Provides mutation-safe access to contained value. That is, caller is free
359 * to modify the returned value, it will not affect the contained data value.
360 * @return cloned value if it is mutable or the original immutable value
364 if (tag != ARRAY || Array.getLength(value) == 0) {
365 return value;
367 Class type = value.getClass();
369 return ((int[])value).clone();
371 return ((byte[])value).clone();
373 return ((short[])value).clone();
375 return ((long[])value).clone();
377 return ((char[])value).clone();
379 return ((boolean[])value).clone();
381 return ((float[])value).clone();
383 return ((double[])value).clone();
385 return ((Object[])value).clone();