001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * https://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.apache.commons.compress.harmony.unpack200.bytecode; 020 021import java.io.DataOutputStream; 022import java.io.IOException; 023 024/** 025 * Deprecated class file attribute. 026 */ 027public class DeprecatedAttribute extends Attribute { 028 029 private static CPUTF8 attributeName; 030 031 public static void setAttributeName(final CPUTF8 cpUTF8Value) { 032 attributeName = cpUTF8Value; 033 } 034 035 /** 036 * Constructs a new instance. 037 */ 038 public DeprecatedAttribute() { 039 super(attributeName); 040 } 041 042 /* 043 * (non-Javadoc) 044 * 045 * @see org.apache.commons.compress.harmony.unpack200.bytecode.Attribute#getLength() 046 */ 047 @Override 048 protected int getLength() { 049 return 0; 050 } 051 052 /* 053 * (non-Javadoc) 054 * 055 * @see org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry#toString() 056 */ 057 @Override 058 public String toString() { 059 return "Deprecated Attribute"; 060 } 061 062 /* 063 * (non-Javadoc) 064 * 065 * @see org.apache.commons.compress.harmony.unpack200.bytecode.Attribute#writeBody(java.io.DataOutputStream) 066 */ 067 @Override 068 protected void writeBody(final DataOutputStream dos) throws IOException { 069 // No body 070 } 071 072}