diff options
Diffstat (limited to 'dx/src/com/android/dx/cf/attrib')
24 files changed, 0 insertions, 1487 deletions
diff --git a/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java b/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java deleted file mode 100644 index 12e1f74ba..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttAnnotationDefault.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.Constant; - -/** - * Attribute class for <code>AnnotationDefault</code> attributes. - */ -public final class AttAnnotationDefault extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "AnnotationDefault"; - - /** non-null; the annotation default value */ - private final Constant value; - - /** >= 0; attribute data length in the original classfile (not - * including the attribute header) */ - private final int byteLength; - - /** - * Constructs an instance. - * - * @param value non-null; the annotation default value - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public AttAnnotationDefault(Constant value, int byteLength) { - super(ATTRIBUTE_NAME); - - if (value == null) { - throw new NullPointerException("value == null"); - } - - this.value = value; - this.byteLength = byteLength; - } - - /** {@inheritDoc} */ - public int byteLength() { - // Add six for the standard attribute header. - return byteLength + 6; - } - - /** - * Gets the annotation default value. - * - * @return non-null; the value - */ - public Constant getValue() { - return value; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttCode.java b/dx/src/com/android/dx/cf/attrib/AttCode.java deleted file mode 100644 index f00da2fde..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttCode.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.cf.code.ByteCatchList; -import com.android.dx.cf.code.BytecodeArray; -import com.android.dx.cf.iface.AttributeList; -import com.android.dx.util.MutabilityException; - -/** - * Attribute class for standard <code>Code</code> attributes. - */ -public final class AttCode extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "Code"; - - /** >= 0; the stack size */ - private final int maxStack; - - /** >= 0; the number of locals */ - private final int maxLocals; - - /** non-null; array containing the bytecode per se */ - private final BytecodeArray code; - - /** non-null; the exception table */ - private final ByteCatchList catches; - - /** non-null; the associated list of attributes */ - private final AttributeList attributes; - - /** - * Constructs an instance. - * - * @param maxStack >= 0; the stack size - * @param maxLocals >= 0; the number of locals - * @param code non-null; array containing the bytecode per se - * @param catches non-null; the exception table - * @param attributes non-null; the associated list of attributes - */ - public AttCode(int maxStack, int maxLocals, BytecodeArray code, - ByteCatchList catches, AttributeList attributes) { - super(ATTRIBUTE_NAME); - - if (maxStack < 0) { - throw new IllegalArgumentException("maxStack < 0"); - } - - if (maxLocals < 0) { - throw new IllegalArgumentException("maxLocals < 0"); - } - - if (code == null) { - throw new NullPointerException("code == null"); - } - - try { - if (catches.isMutable()) { - throw new MutabilityException("catches.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("catches == null"); - } - - try { - if (attributes.isMutable()) { - throw new MutabilityException("attributes.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("attributes == null"); - } - - this.maxStack = maxStack; - this.maxLocals = maxLocals; - this.code = code; - this.catches = catches; - this.attributes = attributes; - } - - public int byteLength() { - return 10 + code.byteLength() + catches.byteLength() + - attributes.byteLength(); - } - - /** - * Gets the maximum stack size. - * - * @return >= 0; the maximum stack size - */ - public int getMaxStack() { - return maxStack; - } - - /** - * Gets the number of locals. - * - * @return >= 0; the number of locals - */ - public int getMaxLocals() { - return maxLocals; - } - - /** - * Gets the bytecode array. - * - * @return non-null; the bytecode array - */ - public BytecodeArray getCode() { - return code; - } - - /** - * Gets the exception table. - * - * @return non-null; the exception table - */ - public ByteCatchList getCatches() { - return catches; - } - - /** - * Gets the associated attribute list. - * - * @return non-null; the attribute list - */ - public AttributeList getAttributes() { - return attributes; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttConstantValue.java b/dx/src/com/android/dx/cf/attrib/AttConstantValue.java deleted file mode 100644 index a84da4342..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttConstantValue.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.CstDouble; -import com.android.dx.rop.cst.CstFloat; -import com.android.dx.rop.cst.CstInteger; -import com.android.dx.rop.cst.CstLong; -import com.android.dx.rop.cst.CstString; -import com.android.dx.rop.cst.TypedConstant; - -/** - * Attribute class for standard <code>ConstantValue</code> attributes. - */ -public final class AttConstantValue extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "ConstantValue"; - - /** non-null; the constant value */ - private final TypedConstant constantValue; - - /** - * Constructs an instance. - * - * @param constantValue non-null; the constant value, which must - * be an instance of one of: <code>CstString</code>, - * <code>CstInteger</code>, <code>CstLong</code>, - * <code>CstFloat</code>, or <code>CstDouble</code> - */ - public AttConstantValue(TypedConstant constantValue) { - super(ATTRIBUTE_NAME); - - if (!((constantValue instanceof CstString) || - (constantValue instanceof CstInteger) || - (constantValue instanceof CstLong) || - (constantValue instanceof CstFloat) || - (constantValue instanceof CstDouble))) { - if (constantValue == null) { - throw new NullPointerException("constantValue == null"); - } - throw new IllegalArgumentException("bad type for constantValue"); - } - - this.constantValue = constantValue; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 8; - } - - /** - * Gets the constant value of this instance. The returned value - * is an instance of one of: <code>CstString</code>, - * <code>CstInteger</code>, <code>CstLong</code>, - * <code>CstFloat</code>, or <code>CstDouble</code>. - * - * @return non-null; the constant value - */ - public TypedConstant getConstantValue() { - return constantValue; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttDeprecated.java b/dx/src/com/android/dx/cf/attrib/AttDeprecated.java deleted file mode 100644 index cd1dd2463..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttDeprecated.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -/** - * Attribute class for standard <code>Deprecated</code> attributes. - */ -public final class AttDeprecated extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "Deprecated"; - - /** - * Constructs an instance. - */ - public AttDeprecated() { - super(ATTRIBUTE_NAME); - } - - /** {@inheritDoc} */ - public int byteLength() { - return 6; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java b/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java deleted file mode 100644 index 7cccad703..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttEnclosingMethod.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.CstNat; -import com.android.dx.rop.cst.CstType; - -/** - * Attribute class for standards-track <code>EnclosingMethod</code> - * attributes. - */ -public final class AttEnclosingMethod extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "EnclosingMethod"; - - /** non-null; the innermost enclosing class */ - private final CstType type; - - /** null-ok; the name-and-type of the innermost enclosing method, if any */ - private final CstNat method; - - /** - * Constructs an instance. - * - * @param type non-null; the innermost enclosing class - * @param method null-ok; the name-and-type of the innermost enclosing - * method, if any - */ - public AttEnclosingMethod(CstType type, CstNat method) { - super(ATTRIBUTE_NAME); - - if (type == null) { - throw new NullPointerException("type == null"); - } - - this.type = type; - this.method = method; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 10; - } - - /** - * Gets the innermost enclosing class. - * - * @return non-null; the innermost enclosing class - */ - public CstType getEnclosingClass() { - return type; - } - - /** - * Gets the name-and-type of the innermost enclosing method, if - * any. - * - * @return null-ok; the name-and-type of the innermost enclosing - * method, if any - */ - public CstNat getMethod() { - return method; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttExceptions.java b/dx/src/com/android/dx/cf/attrib/AttExceptions.java deleted file mode 100644 index 59e624ef8..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttExceptions.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.type.TypeList; -import com.android.dx.util.MutabilityException; - -/** - * Attribute class for standard <code>Exceptions</code> attributes. - */ -public final class AttExceptions extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "Exceptions"; - - /** non-null; list of exception classes */ - private final TypeList exceptions; - - /** - * Constructs an instance. - * - * @param exceptions non-null; list of classes, presumed but not - * verified to be subclasses of <code>Throwable</code> - */ - public AttExceptions(TypeList exceptions) { - super(ATTRIBUTE_NAME); - - try { - if (exceptions.isMutable()) { - throw new MutabilityException("exceptions.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("exceptions == null"); - } - - this.exceptions = exceptions; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 8 + exceptions.size() * 2; - } - - /** - * Gets the list of classes associated with this instance. In - * general, these classes are not pre-verified to be subclasses of - * <code>Throwable</code>. - * - * @return non-null; the list of classes - */ - public TypeList getExceptions() { - return exceptions; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java b/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java deleted file mode 100644 index df305395b..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttInnerClasses.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.util.MutabilityException; - -/** - * Attribute class for standard <code>InnerClasses</code> attributes. - */ -public final class AttInnerClasses extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "InnerClasses"; - - /** non-null; list of inner class entries */ - private final InnerClassList innerClasses; - - /** - * Constructs an instance. - * - * @param innerClasses non-null; list of inner class entries - */ - public AttInnerClasses(InnerClassList innerClasses) { - super(ATTRIBUTE_NAME); - - try { - if (innerClasses.isMutable()) { - throw new MutabilityException("innerClasses.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("innerClasses == null"); - } - - this.innerClasses = innerClasses; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 8 + innerClasses.size() * 8; - } - - /** - * Gets the list of "inner class" entries associated with this instance. - * - * @return non-null; the list - */ - public InnerClassList getInnerClasses() { - return innerClasses; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java b/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java deleted file mode 100644 index c5e65e80d..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttLineNumberTable.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.cf.code.LineNumberList; -import com.android.dx.util.MutabilityException; - -/** - * Attribute class for standard <code>LineNumberTable</code> attributes. - */ -public final class AttLineNumberTable extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "LineNumberTable"; - - /** non-null; list of line number entries */ - private final LineNumberList lineNumbers; - - /** - * Constructs an instance. - * - * @param lineNumbers non-null; list of line number entries - */ - public AttLineNumberTable(LineNumberList lineNumbers) { - super(ATTRIBUTE_NAME); - - try { - if (lineNumbers.isMutable()) { - throw new MutabilityException("lineNumbers.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("lineNumbers == null"); - } - - this.lineNumbers = lineNumbers; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 8 + 4 * lineNumbers.size(); - } - - /** - * Gets the list of "line number" entries associated with this instance. - * - * @return non-null; the list - */ - public LineNumberList getLineNumbers() { - return lineNumbers; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java b/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java deleted file mode 100644 index 893f25477..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTable.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.cf.code.LocalVariableList; - -/** - * Attribute class for standard <code>LocalVariableTable</code> attributes. - */ -public final class AttLocalVariableTable extends BaseLocalVariables { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "LocalVariableTable"; - - /** - * Constructs an instance. - * - * @param localVariables non-null; list of local variable entries - */ - public AttLocalVariableTable(LocalVariableList localVariables) { - super(ATTRIBUTE_NAME, localVariables); - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java b/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java deleted file mode 100644 index 7037b7401..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttLocalVariableTypeTable.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.cf.code.LocalVariableList; - -/** - * Attribute class for standard <code>LocalVariableTypeTable</code> attributes. - */ -public final class AttLocalVariableTypeTable extends BaseLocalVariables { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "LocalVariableTypeTable"; - - /** - * Constructs an instance. - * - * @param localVariables non-null; list of local variable entries - */ - public AttLocalVariableTypeTable(LocalVariableList localVariables) { - super(ATTRIBUTE_NAME, localVariables); - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java deleted file mode 100644 index 583ab17be..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleAnnotations.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.annotation.Annotations; - -/** - * Attribute class for standard <code>RuntimeInvisibleAnnotations</code> - * attributes. - */ -public final class AttRuntimeInvisibleAnnotations extends BaseAnnotations { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "RuntimeInvisibleAnnotations"; - - /** - * Constructs an instance. - * - * @param annotations non-null; the list of annotations - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public AttRuntimeInvisibleAnnotations(Annotations annotations, - int byteLength) { - super(ATTRIBUTE_NAME, annotations, byteLength); - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java deleted file mode 100644 index 08865e153..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeInvisibleParameterAnnotations.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.annotation.AnnotationsList; - -/** - * Attribute class for standard - * <code>RuntimeInvisibleParameterAnnotations</code> attributes. - */ -public final class AttRuntimeInvisibleParameterAnnotations - extends BaseParameterAnnotations { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = - "RuntimeInvisibleParameterAnnotations"; - - /** - * Constructs an instance. - * - * @param parameterAnnotations non-null; the parameter annotations - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public AttRuntimeInvisibleParameterAnnotations( - AnnotationsList parameterAnnotations, int byteLength) { - super(ATTRIBUTE_NAME, parameterAnnotations, byteLength); - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java deleted file mode 100644 index c61acb5c2..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleAnnotations.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.annotation.Annotations; - -/** - * Attribute class for standard <code>RuntimeVisibleAnnotations</code> - * attributes. - */ -public final class AttRuntimeVisibleAnnotations extends BaseAnnotations { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "RuntimeVisibleAnnotations"; - - /** - * Constructs an instance. - * - * @param annotations non-null; the list of annotations - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public AttRuntimeVisibleAnnotations(Annotations annotations, - int byteLength) { - super(ATTRIBUTE_NAME, annotations, byteLength); - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java b/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java deleted file mode 100644 index dfe57b2b6..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttRuntimeVisibleParameterAnnotations.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.annotation.AnnotationsList; - -/** - * Attribute class for standard <code>RuntimeVisibleParameterAnnotations</code> - * attributes. - */ -public final class AttRuntimeVisibleParameterAnnotations - extends BaseParameterAnnotations { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = - "RuntimeVisibleParameterAnnotations"; - - /** - * Constructs an instance. - * - * @param annotations non-null; the parameter annotations - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public AttRuntimeVisibleParameterAnnotations( - AnnotationsList annotations, int byteLength) { - super(ATTRIBUTE_NAME, annotations, byteLength); - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttSignature.java b/dx/src/com/android/dx/cf/attrib/AttSignature.java deleted file mode 100644 index 97edbbdd0..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttSignature.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.CstUtf8; - -/** - * Attribute class for standards-track <code>Signature</code> attributes. - */ -public final class AttSignature extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "Signature"; - - /** non-null; the signature string */ - private final CstUtf8 signature; - - /** - * Constructs an instance. - * - * @param signature non-null; the signature string - */ - public AttSignature(CstUtf8 signature) { - super(ATTRIBUTE_NAME); - - if (signature == null) { - throw new NullPointerException("signature == null"); - } - - this.signature = signature; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 8; - } - - /** - * Gets the signature string. - * - * @return non-null; the signature string - */ - public CstUtf8 getSignature() { - return signature; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttSourceFile.java b/dx/src/com/android/dx/cf/attrib/AttSourceFile.java deleted file mode 100644 index f0872178f..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttSourceFile.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.CstUtf8; - -/** - * Attribute class for standard <code>SourceFile</code> attributes. - */ -public final class AttSourceFile extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "SourceFile"; - - /** non-null; name of the source file */ - private final CstUtf8 sourceFile; - - /** - * Constructs an instance. - * - * @param sourceFile non-null; the name of the source file - */ - public AttSourceFile(CstUtf8 sourceFile) { - super(ATTRIBUTE_NAME); - - if (sourceFile == null) { - throw new NullPointerException("sourceFile == null"); - } - - this.sourceFile = sourceFile; - } - - /** {@inheritDoc} */ - public int byteLength() { - return 8; - } - - /** - * Gets the source file name of this instance. - * - * @return non-null; the source file - */ - public CstUtf8 getSourceFile() { - return sourceFile; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/AttSynthetic.java b/dx/src/com/android/dx/cf/attrib/AttSynthetic.java deleted file mode 100644 index daa9b0c23..000000000 --- a/dx/src/com/android/dx/cf/attrib/AttSynthetic.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -/** - * Attribute class for standard <code>Synthetic</code> attributes. - */ -public final class AttSynthetic extends BaseAttribute { - /** non-null; attribute name for attributes of this type */ - public static final String ATTRIBUTE_NAME = "Synthetic"; - - /** - * Constructs an instance. - */ - public AttSynthetic() { - super(ATTRIBUTE_NAME); - } - - /** {@inheritDoc} */ - public int byteLength() { - return 6; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java b/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java deleted file mode 100644 index 0163e2cb4..000000000 --- a/dx/src/com/android/dx/cf/attrib/BaseAnnotations.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.annotation.Annotations; -import com.android.dx.util.MutabilityException; - -/** - * Base class for annotations attributes. - */ -public abstract class BaseAnnotations extends BaseAttribute { - /** non-null; list of annotations */ - private final Annotations annotations; - - /** >= 0; attribute data length in the original classfile (not - * including the attribute header) */ - private final int byteLength; - - /** - * Constructs an instance. - * - * @param attributeName non-null; the name of the attribute - * @param annotations non-null; the list of annotations - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public BaseAnnotations(String attributeName, Annotations annotations, - int byteLength) { - super(attributeName); - - try { - if (annotations.isMutable()) { - throw new MutabilityException("annotations.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("annotations == null"); - } - - this.annotations = annotations; - this.byteLength = byteLength; - } - - /** {@inheritDoc} */ - public final int byteLength() { - // Add six for the standard attribute header. - return byteLength + 6; - } - - /** - * Gets the list of annotations associated with this instance. - * - * @return non-null; the list - */ - public final Annotations getAnnotations() { - return annotations; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/BaseAttribute.java b/dx/src/com/android/dx/cf/attrib/BaseAttribute.java deleted file mode 100644 index ef1c6ac0d..000000000 --- a/dx/src/com/android/dx/cf/attrib/BaseAttribute.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.cf.iface.Attribute; - -/** - * Base implementation of {@link Attribute}, which directly stores - * the attribute name but leaves the rest up to subclasses. - */ -public abstract class BaseAttribute implements Attribute { - /** non-null; attribute name */ - private final String name; - - /** - * Constructs an instance. - * - * @param name non-null; attribute name - */ - public BaseAttribute(String name) { - if (name == null) { - throw new NullPointerException("name == null"); - } - - this.name = name; - } - - /** {@inheritDoc} */ - public String getName() { - return name; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java b/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java deleted file mode 100644 index a39e72438..000000000 --- a/dx/src/com/android/dx/cf/attrib/BaseLocalVariables.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.cf.code.LocalVariableList; -import com.android.dx.util.MutabilityException; - -/** - * Base attribute class for standard <code>LocalVariableTable</code> - * and <code>LocalVariableTypeTable</code> attributes. - */ -public abstract class BaseLocalVariables extends BaseAttribute { - /** non-null; list of local variable entries */ - private final LocalVariableList localVariables; - - /** - * Constructs an instance. - * - * @param name non-null; attribute name - * @param localVariables non-null; list of local variable entries - */ - public BaseLocalVariables(String name, - LocalVariableList localVariables) { - super(name); - - try { - if (localVariables.isMutable()) { - throw new MutabilityException("localVariables.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("localVariables == null"); - } - - this.localVariables = localVariables; - } - - /** {@inheritDoc} */ - public final int byteLength() { - return 8 + localVariables.size() * 10; - } - - /** - * Gets the list of "local variable" entries associated with this instance. - * - * @return non-null; the list - */ - public final LocalVariableList getLocalVariables() { - return localVariables; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java b/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java deleted file mode 100644 index a927e3d5f..000000000 --- a/dx/src/com/android/dx/cf/attrib/BaseParameterAnnotations.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.annotation.AnnotationsList; -import com.android.dx.util.MutabilityException; - -/** - * Base class for parameter annotation list attributes. - */ -public abstract class BaseParameterAnnotations extends BaseAttribute { - /** non-null; list of annotations */ - private final AnnotationsList parameterAnnotations; - - /** >= 0; attribute data length in the original classfile (not - * including the attribute header) */ - private final int byteLength; - - /** - * Constructs an instance. - * - * @param attributeName non-null; the name of the attribute - * @param parameterAnnotations non-null; the annotations - * @param byteLength >= 0; attribute data length in the original - * classfile (not including the attribute header) - */ - public BaseParameterAnnotations(String attributeName, - AnnotationsList parameterAnnotations, int byteLength) { - super(attributeName); - - try { - if (parameterAnnotations.isMutable()) { - throw new MutabilityException( - "parameterAnnotations.isMutable()"); - } - } catch (NullPointerException ex) { - // Translate the exception. - throw new NullPointerException("parameterAnnotations == null"); - } - - this.parameterAnnotations = parameterAnnotations; - this.byteLength = byteLength; - } - - /** {@inheritDoc} */ - public final int byteLength() { - // Add six for the standard attribute header. - return byteLength + 6; - } - - /** - * Gets the list of annotation lists associated with this instance. - * - * @return non-null; the list - */ - public final AnnotationsList getParameterAnnotations() { - return parameterAnnotations; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/InnerClassList.java b/dx/src/com/android/dx/cf/attrib/InnerClassList.java deleted file mode 100644 index 3585f1db8..000000000 --- a/dx/src/com/android/dx/cf/attrib/InnerClassList.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.CstType; -import com.android.dx.rop.cst.CstUtf8; -import com.android.dx.util.FixedSizeList; - -/** - * List of "inner class" entries, which are the contents of - * <code>InnerClasses</code> attributes. - */ -public final class InnerClassList extends FixedSizeList { - /** - * Constructs an instance. - * - * @param count the number of elements to be in the list of inner classes - */ - public InnerClassList(int count) { - super(count); - } - - /** - * Gets the indicated item. - * - * @param n >= 0; which item - * @return null-ok; the indicated item - */ - public Item get(int n) { - return (Item) get0(n); - } - - /** - * Sets the item at the given index. - * - * @param n >= 0, < size(); which class - * @param innerClass non-null; class this item refers to - * @param outerClass null-ok; outer class that this class is a - * member of, if any - * @param innerName null-ok; original simple name of this class, - * if not anonymous - * @param accessFlags original declared access flags - */ - public void set(int n, CstType innerClass, CstType outerClass, - CstUtf8 innerName, int accessFlags) { - set0(n, new Item(innerClass, outerClass, innerName, accessFlags)); - } - - /** - * Item in an inner classes list. - */ - public static class Item { - /** non-null; class this item refers to */ - private final CstType innerClass; - - /** null-ok; outer class that this class is a member of, if any */ - private final CstType outerClass; - - /** null-ok; original simple name of this class, if not anonymous */ - private final CstUtf8 innerName; - - /** original declared access flags */ - private final int accessFlags; - - /** - * Constructs an instance. - * - * @param innerClass non-null; class this item refers to - * @param outerClass null-ok; outer class that this class is a - * member of, if any - * @param innerName null-ok; original simple name of this - * class, if not anonymous - * @param accessFlags original declared access flags - */ - public Item(CstType innerClass, CstType outerClass, - CstUtf8 innerName, int accessFlags) { - if (innerClass == null) { - throw new NullPointerException("innerClass == null"); - } - - this.innerClass = innerClass; - this.outerClass = outerClass; - this.innerName = innerName; - this.accessFlags = accessFlags; - } - - /** - * Gets the class this item refers to. - * - * @return non-null; the class - */ - public CstType getInnerClass() { - return innerClass; - } - - /** - * Gets the outer class that this item's class is a member of, if any. - * - * @return null-ok; the class - */ - public CstType getOuterClass() { - return outerClass; - } - - /** - * Gets the original name of this item's class, if not anonymous. - * - * @return null-ok; the name - */ - public CstUtf8 getInnerName() { - return innerName; - } - - /** - * Gets the original declared access flags. - * - * @return the access flags - */ - public int getAccessFlags() { - return accessFlags; - } - } -} diff --git a/dx/src/com/android/dx/cf/attrib/RawAttribute.java b/dx/src/com/android/dx/cf/attrib/RawAttribute.java deleted file mode 100644 index b89926d8a..000000000 --- a/dx/src/com/android/dx/cf/attrib/RawAttribute.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.dx.cf.attrib; - -import com.android.dx.rop.cst.ConstantPool; -import com.android.dx.util.ByteArray; - -/** - * Raw attribute, for holding onto attributes that are unrecognized. - */ -public final class RawAttribute extends BaseAttribute { - /** non-null; attribute data */ - private final ByteArray data; - - /** - * null-ok; constant pool to use for resolution of cpis in {@link - * #data} - */ - private final ConstantPool pool; - - /** - * Constructs an instance. - * - * @param name non-null; attribute name - * @param data non-null; attribute data - * @param pool null-ok; constant pool to use for cpi resolution - */ - public RawAttribute(String name, ByteArray data, ConstantPool pool) { - super(name); - - if (data == null) { - throw new NullPointerException("data == null"); - } - - this.data = data; - this.pool = pool; - } - - /** - * Constructs an instance from a sub-array of a {@link ByteArray}. - * - * @param name non-null; attribute name - * @param data non-null; array containing the attribute data - * @param offset offset in <code>data</code> to the attribute data - * @param length length of the attribute data, in bytes - * @param pool null-ok; constant pool to use for cpi resolution - */ - public RawAttribute(String name, ByteArray data, int offset, - int length, ConstantPool pool) { - this(name, data.slice(offset, offset + length), pool); - } - - /** - * Get the raw data of the attribute. - * - * @return non-null; the data - */ - public ByteArray getData() { - return data; - } - - /** {@inheritDoc} */ - public int byteLength() { - return data.size() + 6; - } - - /** - * Gets the constant pool to use for cpi resolution, if any. It - * presumably came from the class file that this attribute came - * from. - * - * @return null-ok; the constant pool - */ - public ConstantPool getPool() { - return pool; - } -} diff --git a/dx/src/com/android/dx/cf/attrib/package.html b/dx/src/com/android/dx/cf/attrib/package.html deleted file mode 100644 index 8125079a4..000000000 --- a/dx/src/com/android/dx/cf/attrib/package.html +++ /dev/null @@ -1,11 +0,0 @@ -<body> -<p>Implementation of containers and utilities for all the standard Java -attribute types.</p> - -<p><b>PACKAGES USED:</b> -<ul> -<li><code>com.android.dx.cf.iface</code></li> -<li><code>com.android.dx.rop.pool</code></li> -<li><code>com.android.dx.util</code></li> -</ul> -</body> |