java.io
Class ObjectStreamField
- Comparable<T>
This class intends to describe the field of a class for the serialization
subsystem. Serializable fields in a serializable class can be explicitly
exported using an array of ObjectStreamFields.
ObjectStreamField(String name, Class> type) - This constructor creates an ObjectStreamField instance
which represents a field named
name and is
of the type type .
|
ObjectStreamField(String name, Class> type, boolean unshared) - This constructor creates an ObjectStreamField instance
which represents a field named
name and is
of the type type .
|
int | compareTo(Object obj) - Compares this object to the given object.
|
String | getName() - This method returns the name of the field represented by the
ObjectStreamField instance.
|
int | getOffset() - This method returns the current offset of the field in
the serialization stream relatively to the other fields.
|
Class> | getType() - This method returns the class representing the type of the
field which is represented by this instance of ObjectStreamField.
|
char | getTypeCode() - This method returns the char encoded type of the field which
is represented by this instance of ObjectStreamField.
|
String | getTypeString() - This method returns a more explicit type name than
getTypeCode() in the case the type is a real
class (and not a primitive).
|
boolean | isPrimitive() - This method returns true if the type of the field
represented by this instance is a primitive.
|
boolean | isUnshared() - This method returns whether the field represented by this object is
unshared or not.
|
protected void | setOffset(int off) - This method sets the current offset of the field.
|
String | toString() - Returns a string representing this object.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
ObjectStreamField
public ObjectStreamField(String name,
Class> type)
This constructor creates an ObjectStreamField instance
which represents a field named name
and is
of the type type
.
name
- Name of the field to export.type
- Type of the field in the concerned class.
ObjectStreamField
public ObjectStreamField(String name,
Class> type,
boolean unshared)
This constructor creates an ObjectStreamField instance
which represents a field named name
and is
of the type type
.
name
- Name of the field to export.type
- Type of the field in the concerned class.unshared
- true if field will be unshared, false otherwise.
compareTo
public int compareTo(Object obj)
Compares this object to the given object.
obj
- the object to compare to.
getName
public String getName()
This method returns the name of the field represented by the
ObjectStreamField instance.
- A string containing the name of the field.
getOffset
public int getOffset()
This method returns the current offset of the field in
the serialization stream relatively to the other fields.
The offset is expressed in bytes.
- The offset of the field in bytes.
getType
public Class> getType()
This method returns the class representing the type of the
field which is represented by this instance of ObjectStreamField.
- A class representing the type of the field.
getTypeCode
public char getTypeCode()
This method returns the char encoded type of the field which
is represented by this instance of ObjectStreamField.
- A char representing the type of the field.
getTypeString
public String getTypeString()
This method returns a more explicit type name than
getTypeCode()
in the case the type is a real
class (and not a primitive).
- The name of the type (class name) if it is not a
primitive, in the other case null is returned.
isPrimitive
public boolean isPrimitive()
This method returns true if the type of the field
represented by this instance is a primitive.
- true if the type is a primitive, false
in the other case.
isUnshared
public boolean isUnshared()
This method returns whether the field represented by this object is
unshared or not.
- Tells if this field is unshared or not.
setOffset
protected void setOffset(int off)
This method sets the current offset of the field.
off
- The offset of the field in bytes.
ObjectStreamField.java -- Class used to store name and class of fields
Copyright (C) 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.