Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DeclareMixin.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*******************************************************************************
  2. * Copyright (c) 2009 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * initial implementation Andy Clement
  11. *******************************************************************************/
  12. package org.aspectj.lang.annotation;
  13. import java.lang.annotation.ElementType;
  14. import java.lang.annotation.Retention;
  15. import java.lang.annotation.RetentionPolicy;
  16. import java.lang.annotation.Target;
  17. /**
  18. * DeclareMixin annotation - see design and usage in https://bugs.eclipse.org/bugs/show_bug.cgi?id=266552
  19. * <p>
  20. * Attached to a factory method, this annotation indicates that any types matching the pattern specified in the annotation value
  21. * will have new methods mixed in. The methods will be selected based on a combination of the return type of the factory method,
  22. * possibly sub-setted by any list of interfaces specified in the interfaces annotation value.
  23. */
  24. @Retention(RetentionPolicy.RUNTIME)
  25. @Target(ElementType.METHOD)
  26. public @interface DeclareMixin {
  27. /**
  28. * @return the target types expression
  29. */
  30. String value();
  31. /**
  32. * @return array of interfaces that are to be mixed in. This is optional and if not specified the return type of the annotated method
  33. * will be used to determine the interface to mix in.
  34. */
  35. Class[] interfaces() default { Object.class };
  36. }