Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

EclipseConstantPoolWriter.java 1.1KB

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 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. * Andy Clement (SpringSource)
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
  14. import org.aspectj.weaver.ConstantPoolWriter;
  15. /**
  16. * An implementation of the constant pool writer that speaks Eclipse.
  17. *
  18. * @author Andy Clement
  19. */
  20. public class EclipseConstantPoolWriter implements ConstantPoolWriter {
  21. private ConstantPool constantPool;
  22. public EclipseConstantPoolWriter(ConstantPool constantPool) {
  23. this.constantPool = constantPool;
  24. }
  25. public int writeUtf8(String name) {
  26. return constantPool.literalIndex(name.toCharArray());
  27. }
  28. }