ObjectStreamField.java revision 6380
2362N/A * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A description of a Serializable field from a Serializable class. An array 0N/A * of ObjectStreamFields is used to declare the Serializable fields of a class. 0N/A * @author Mike Warres 0N/A * @author Roger Riggs 0N/A * @see ObjectStreamClass 0N/A /** canonical JVM signature of field type */ 0N/A /** field type (Object.class if unknown non-primitive type) */ 0N/A /** whether or not to (de)serialize field values as unshared */ 0N/A /** corresponding reflective field object, if any */ 0N/A /** offset of field value in enclosing field group */ 0N/A * Create a Serializable field with the specified type. This field should 0N/A * be documented with a <code>serialField</code> tag. 0N/A * @param name the name of the serializable field 0N/A * @param type the <code>Class</code> object of the serializable field 0N/A * Creates an ObjectStreamField representing a serializable field with the 0N/A * given name and type. If unshared is false, values of the represented 0N/A * field are serialized and deserialized in the default manner--if the 0N/A * field is non-primitive, object values are serialized and deserialized as 0N/A * if they had been written and read by calls to writeObject and 0N/A * readObject. If unshared is true, values of the represented field are 0N/A * serialized and deserialized as if they had been written and read by 0N/A * calls to writeUnshared and readUnshared. 0N/A * @param name field name 0N/A * @param type field type 0N/A * @param unshared if false, write/read field values in the same manner 0N/A * Creates an ObjectStreamField representing a field with the given name, 0N/A * signature and unshared setting. 0N/A * Creates an ObjectStreamField representing the given field with the 0N/A * specified unshared setting. For compatibility with the behavior of 0N/A * earlier serialization implementations, a "showType" parameter is 0N/A * necessary to govern whether or not a getType() call on this 0N/A * ObjectStreamField (if non-primitive) will return Object.class (as 0N/A * opposed to a more specific reference type). 0N/A * Get the name of this field. 0N/A * @return a <code>String</code> representing the name of the serializable 0N/A * Get the type of the field. If the type is non-primitive and this 0N/A * <code>ObjectStreamField</code> was obtained from a deserialized {@link 0N/A * ObjectStreamClass} instance, then <code>Object.class</code> is returned. 0N/A * Otherwise, the <code>Class</code> object for the type of the field is 0N/A * @return a <code>Class</code> object representing the type of the 0N/A * serializable field 0N/A * Returns character encoding of field type. The encoding is as follows: 0N/A * L class or interface 0N/A * </pre></blockquote> 0N/A * @return the typecode of the serializable field 0N/A // REMIND: deprecate? 0N/A * Return the JVM type signature. 0N/A * @return null if this field has a primitive type. 0N/A // REMIND: deprecate? 0N/A * Offset of field within instance data. 0N/A * @return the offset of this field 0N/A // REMIND: deprecate? 0N/A * Offset within instance data. 0N/A * @param offset the offset of the field 0N/A // REMIND: deprecate? 0N/A * Return true if this field has a primitive type. 0N/A * @return true if and only if this field corresponds to a primitive type 0N/A // REMIND: deprecate? 0N/A * Returns boolean value indicating whether or not the serializable field 0N/A * represented by this ObjectStreamField instance is unshared. 0N/A * Compare this field with another <code>ObjectStreamField</code>. Return 0N/A * -1 if this is smaller, 0 if equal, 1 if greater. Types that are 0N/A * primitives are "smaller" than object types. If equal, the field names 0N/A // REMIND: deprecate? 0N/A * Return a string that describes this field. 0N/A * Returns field represented by this ObjectStreamField, or null if 0N/A * ObjectStreamField is not associated with an actual field. 0N/A * Returns JVM type signature of field (similar to getTypeString, except 0N/A * that signature strings are returned for primitive fields as well). 1805N/A * Returns JVM type signature for given class.