private void writeObject ( java . io . ObjectOutputStream out ) throws IOException { // // When serializing, compute sufficient information about the annotated element to // allow it to be reassociated later in readObject // if ( _annotElem instanceof Class ) { _elemClass = ( Class ) _annotElem ; _elemDesc = null ; // non required } else if ( _annotElem instanceof Field ) { Field f = ( Field ) _annotElem ; _elemClass = f . getDeclaringClass ( ) ; _elemDesc = f . getName ( ) ; } else if ( _annotElem instanceof Method ) { Method m = ( Method ) _annotElem ; _elemClass = m . getDeclaringClass ( ) ; _elemDesc = m . getName ( ) + "(" + getMethodArgs ( m ) + ")" ; } out . defaultWriteObject ( ) ; }
Overrides the standard Serialization writeObject method to compute and store the element information in a serializable form .