Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

MakeDeclsPublicVisitor.java 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.eclipse.jdt.internal.compiler.ASTVisitor;
  14. //import org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration;
  15. import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
  16. import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
  17. import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
  18. //import org.eclipse.jdt.internal.compiler.ast.LocalTypeDeclaration;
  19. import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
  20. import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
  21. import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
  22. import 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. decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
  30. }
  31. public void endVisit(FieldDeclaration decl, MethodScope scope) {
  32. decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
  33. }
  34. public void endVisit(MethodDeclaration decl, ClassScope scope) {
  35. decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
  36. }
  37. /* (non-Javadoc)
  38. * @see org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
  39. */
  40. public void endVisit(
  41. TypeDeclaration localTypeDeclaration,
  42. BlockScope scope) {
  43. localTypeDeclaration.binding.modifiers = AstUtil.makePublic(localTypeDeclaration.binding.modifiers);
  44. }
  45. /* (non-Javadoc)
  46. * @see org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.eclipse.jdt.internal.compiler.lookup.ClassScope)
  47. */
  48. public void endVisit(
  49. TypeDeclaration memberTypeDeclaration,
  50. ClassScope scope) {
  51. memberTypeDeclaration.binding.modifiers = AstUtil.makePublic(memberTypeDeclaration.binding.modifiers);
  52. }
  53. }