/** * Annotates the stream descriptor for the class <code>cl</code>. * * <p><code>AnnotatedObjectOutputStream</code> implements this method as follows: * * <p>This method invokes this stream's {@link #writeAnnotation writeAnnotation} method with the * given cl. * * @param cl the class to annotate * @throws IOException if <code>writeAnnotation</code> throws an <code>IOException</code> * @throws NullPointerException if <code>cl</code> is <code>null</code> **/ @Override protected void annotateClass(Class cl) throws IOException { writeAnnotation(cl); }
/** * Annotates the stream descriptor for the proxy class <code>cl</code>. * * <p><code>AnnotatedObjectOutputStream</code> implements this method as follows: * * <p>This method invokes this stream's {@link #writeAnnotation writeAnnotation} method with the * given cl. * * @param cl the proxy class to annotate * @throws IOException if <code>writeAnnotation</code> throws an <code>IOException</code> * @throws NullPointerException if <code>cl</code> is <code>null</code> **/ @Override protected void annotateProxyClass(Class cl) throws IOException { writeAnnotation(cl); }
/** * First checks that this class wasn't written already, if it does do nothing. * * <p>Else invokes {@link RMIClassLoader#getClassAnnotation RMIClassLoader.getClassAnnotation} * with <code>cl</code> to get the appropriate class annotation string value (possibly * <code>null</code>) and then writes a class annotation string value (possibly * <code>null</code>) to be read by a corresponding <code>MarshalInputStream</code> * implementation. * * <p><code>MarshalOutputStream</code> implements this method to just write the annotation value * to this stream using {@link ObjectOutputStream#writeUnshared writeUnshared}. * * <p>A subclass can override this method to write the annotation to a different location. * * @param annotation the class annotation string value (possibly <code>null</code>) to write * @throws IOException if I/O exception occurs writing the annotation **/ @Override protected void writeAnnotation(Class cl) throws IOException { if (_context.containsAnnotation(cl)) return; _context.addAnnotation(cl); super.writeAnnotation(cl); }