Source code: com/chaoswg/xtc4y/classdesc/DeprecatedAttribute.java
1 //$Header: /cvsroot/xtc4y/xtc4y/src/com/chaoswg/xtc4y/classdesc/DeprecatedAttribute.java,v 1.1.1.1 2003/08/07 13:40:30 toggm Exp $
2 /******************************************************************************
3 * XTC4y - eXtreme Testing Collection 4 you *
4 * -------------------------------------------------------------------------- *
5 * URL: http://www.chaoswg.com/xtc4y *
6 * Author: Mike Toggweiler (2.dog@gmx.ch) *
7 * *
8 * Last Updated: $Date: 2003/08/07 13:40:30 $, by $Author: toggm $ *
9 * Version: $Revision: 1.1.1.1 $ *
10 * -------------------------------------------------------------------------- *
11 * COPYRIGHT: (c) 2003 by Mike Toggweiler *
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 *****************************************************************************/
18 package com.chaoswg.xtc4y.classdesc;
19
20 import java.io.DataInputStream;
21 import java.io.DataOutputStream;
22 import java.io.IOException;
23
24 /**
25 * This class describes the information for a deprecated attribute ($4.7.10)
26 * @author Mike Toggweiler
27 **/
28 public class DeprecatedAttribute extends Attribute {
29
30 public static final String NAME = "Deprecated";
31
32
33 /**
34 * Creates a DeprecatedAttribute and initializes it from a
35 * DataInputStream
36 * The attribute name and length
37 * of the attribute information was already read.
38 * @param dis the DataInputStream to read from
39 * @param cp the constant pool to resolve indices
40 * @param length the length of the attribute information provided
41 * on the DataInputStream
42 **/
43 protected DeprecatedAttribute(DataInputStream dis, ConstantPool cp,
44 int length)
45 throws IOException {
46 super(dis, cp, length);
47
48 if (!getName().equals(NAME)) {
49 throw new ClassFormatError("Attribute name does not match");
50 }
51 }
52
53 /**
54 * construct a new deprecated attribute
55 **/
56 public DeprecatedAttribute() {
57 }
58
59 /**
60 * Write the attribute information onto the DataOutputStream, using the
61 * constant pool to register variables. The Attribute name and the
62 * length of the information will already be written. A specific
63 * attribute implementation should overwrite this method.
64 * @param dos the DataOutputStream to write on
65 * @param cp The constant pool to register variables
66 **/
67 protected void writeAttribute(DataOutputStream dos, ConstantPool cp)
68 throws IOException {
69 }
70
71 /**
72 * @return the name of the attribute
73 **/
74 public String getName() {
75 return NAME;
76 }
77 }