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.

BcelConstantPoolWriter.java 951B

12345678910111213141516171819202122232425262728293031323334
  1. /* *******************************************************************
  2. * Copyright (c) 2010 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://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Andy Clement (SpringSource)
  11. * ******************************************************************/
  12. package org.aspectj.weaver.bcel;
  13. import org.aspectj.apache.bcel.classfile.ConstantPool;
  14. import org.aspectj.weaver.ConstantPoolWriter;
  15. /**
  16. * An implementation of the constant pool writer that speaks Bcel.
  17. *
  18. * @author Andy Clement
  19. */
  20. class BcelConstantPoolWriter implements ConstantPoolWriter {
  21. ConstantPool pool;
  22. public BcelConstantPoolWriter(ConstantPool pool) {
  23. this.pool = pool;
  24. }
  25. public int writeUtf8(String name) {
  26. return pool.addUtf8(name);
  27. }
  28. }