Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AnnotationDefault.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* *******************************************************************
  2. * Copyright (c) 2004 IBM Corporation
  3. *
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Andy Clement initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.apache.bcel.classfile;
  14. import java.io.DataInputStream;
  15. import java.io.DataOutputStream;
  16. import java.io.IOException;
  17. import org.aspectj.apache.bcel.Constants;
  18. import org.aspectj.apache.bcel.classfile.annotation.ElementValue;
  19. /**
  20. * This attribute is attached to a method and indicates the default
  21. * value for an annotation element.
  22. */
  23. public class AnnotationDefault extends Attribute {
  24. private ElementValue value;
  25. public AnnotationDefault(int nameIndex, int len, DataInputStream dis, ConstantPool cpool) throws IOException {
  26. this(nameIndex, len, ElementValue.readElementValue(dis,cpool), cpool);
  27. }
  28. private AnnotationDefault(int nameIndex, int len, ElementValue value, ConstantPool cpool) {
  29. super(Constants.ATTR_ANNOTATION_DEFAULT, nameIndex, len, cpool);
  30. this.value = value;
  31. }
  32. public void accept(Visitor v) {
  33. v.visitAnnotationDefault(this);
  34. }
  35. public Attribute copy(ConstantPool constant_pool) {
  36. throw new RuntimeException("Not implemented yet!");
  37. // is this next line sufficient?
  38. // return (EnclosingMethod)clone();
  39. }
  40. public final ElementValue getElementValue() { return value; }
  41. public final void dump(DataOutputStream dos) throws IOException {
  42. super.dump(dos);
  43. value.dump(dos);
  44. }
  45. }