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.

MakeDeclsPublicVisitor.java 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
  14. //import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration;
  15. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
  16. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
  17. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
  18. //import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalTypeDeclaration;
  19. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
  20. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
  21. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
  22. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
  23. /**
  24. * Takes a method that already has the three extra parameters
  25. * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart
  26. */
  27. public class MakeDeclsPublicVisitor extends ASTVisitor {
  28. public void endVisit(ConstructorDeclaration decl, ClassScope scope) {
  29. if (decl.binding==null) return;
  30. decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
  31. }
  32. public void endVisit(FieldDeclaration decl, MethodScope scope) {
  33. if (decl.binding==null) return;
  34. decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
  35. }
  36. public void endVisit(MethodDeclaration decl, ClassScope scope) {
  37. if (decl.binding==null) return;
  38. decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
  39. }
  40. /* (non-Javadoc)
  41. * @see org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
  42. */
  43. public void endVisit(
  44. TypeDeclaration localTypeDeclaration,
  45. BlockScope scope) {
  46. if (localTypeDeclaration.binding==null) return;
  47. localTypeDeclaration.binding.modifiers = AstUtil.makePublic(localTypeDeclaration.binding.modifiers);
  48. }
  49. /* (non-Javadoc)
  50. * @see org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.eclipse.jdt.internal.compiler.lookup.ClassScope)
  51. */
  52. public void endVisit(
  53. TypeDeclaration memberTypeDeclaration,
  54. ClassScope scope) {
  55. if (memberTypeDeclaration.binding==null) return;
  56. memberTypeDeclaration.binding.modifiers = AstUtil.makePublic(memberTypeDeclaration.binding.modifiers);
  57. }
  58. }