1. /*
  2. * Copyright 2003-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.attributes;
  17. import java.lang.reflect.Field;
  18. import java.lang.reflect.Constructor;
  19. import java.lang.reflect.Method;
  20. import java.util.ArrayList;
  21. import java.util.Collection;
  22. /**
  23. * Null implementation of a cached repository.
  24. */
  25. class EmptyCachedRepository implements CachedRepository {
  26. private final static Collection EMPTY_COLLECTION = new ArrayList (0);
  27. public Collection getAttributes () {
  28. return EMPTY_COLLECTION;
  29. }
  30. public Collection getAttributes (Field f) {
  31. return EMPTY_COLLECTION;
  32. }
  33. public Collection getAttributes (Method m) {
  34. return EMPTY_COLLECTION;
  35. }
  36. public Collection getParameterAttributes (Constructor c, int parameter) {
  37. return EMPTY_COLLECTION;
  38. }
  39. public Collection getParameterAttributes (Method m, int parameter) {
  40. return EMPTY_COLLECTION;
  41. }
  42. public Collection getReturnAttributes (Method m) {
  43. return EMPTY_COLLECTION;
  44. }
  45. public Collection getAttributes (Constructor c) {
  46. return EMPTY_COLLECTION;
  47. }
  48. }