You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestShadow.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  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://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver;
  13. import org.aspectj.bridge.ISourceLocation;
  14. import org.aspectj.weaver.ast.Var;
  15. public class TestShadow extends Shadow {
  16. private final World world;
  17. private final UnresolvedType thisType;
  18. public TestShadow(Kind kind, Member signature, UnresolvedType thisType, World world) {
  19. super(kind, signature, null);
  20. this.world = world;
  21. this.thisType = thisType;
  22. }
  23. public World getIWorld() {
  24. return world;
  25. }
  26. /** this is subtly wrong. ha ha */
  27. public UnresolvedType getEnclosingType() {
  28. return thisType;
  29. }
  30. public Var getThisVar() {
  31. // we should thorw if we don't have a this
  32. return new Var(getThisType().resolve(world));
  33. }
  34. public Var getTargetVar() {
  35. if (!hasTarget())
  36. throw new RuntimeException("bad");
  37. return new Var(getTargetType().resolve(world));
  38. }
  39. public Var getArgVar(int i) {
  40. return new Var(getArgType(i).resolve(world));
  41. }
  42. public Var getThisEnclosingJoinPointStaticPartVar() {
  43. throw new RuntimeException("unimplemented");
  44. }
  45. public Var getThisAspectInstanceVar(ResolvedType aspectType) {
  46. throw new RuntimeException("unimplemented");
  47. }
  48. public Var getThisJoinPointStaticPartVar() {
  49. throw new RuntimeException("unimplemented");
  50. }
  51. public Var getThisJoinPointVar() {
  52. throw new RuntimeException("unimplemented");
  53. }
  54. public ISourceLocation getSourceLocation() {
  55. throw new RuntimeException("unimplemented");
  56. }
  57. public Member getEnclosingCodeSignature() {
  58. throw new RuntimeException("unimplemented");
  59. }
  60. /*
  61. * (non-Javadoc)
  62. *
  63. * @see org.aspectj.weaver.Shadow#getKindedAnnotationVar()
  64. */
  65. public Var getKindedAnnotationVar(UnresolvedType annotationType) {
  66. throw new RuntimeException("unimplemented");
  67. }
  68. /*
  69. * (non-Javadoc)
  70. *
  71. * @see org.aspectj.weaver.Shadow#getWithinAnnotationVar()
  72. */
  73. public Var getWithinAnnotationVar(UnresolvedType annotationType) {
  74. throw new RuntimeException("unimplemented");
  75. }
  76. /*
  77. * (non-Javadoc)
  78. *
  79. * @see org.aspectj.weaver.Shadow#getWithinCodeAnnotationVar()
  80. */
  81. public Var getWithinCodeAnnotationVar(UnresolvedType annotationType) {
  82. throw new RuntimeException("unimplemented");
  83. }
  84. /*
  85. * (non-Javadoc)
  86. *
  87. * @see org.aspectj.weaver.Shadow#getThisAnnotationVar()
  88. */
  89. public Var getThisAnnotationVar(UnresolvedType annotationType) {
  90. throw new RuntimeException("unimplemented");
  91. }
  92. /*
  93. * (non-Javadoc)
  94. *
  95. * @see org.aspectj.weaver.Shadow#getTargetAnnotationVar()
  96. */
  97. public Var getTargetAnnotationVar(UnresolvedType annotationType) {
  98. throw new RuntimeException("unimplemented");
  99. }
  100. /*
  101. * (non-Javadoc)
  102. *
  103. * @see org.aspectj.weaver.Shadow#getArgAnnotationVar(int)
  104. */
  105. public Var getArgAnnotationVar(int i, UnresolvedType annotationType) {
  106. throw new RuntimeException("unimplemented");
  107. }
  108. }