View Javadoc

1   
2   
3   /*
4    * Copyright (C) 2005 by Arno Schumacher
5    *
6    * This file is part of net.sourceforge.servletspy
7    *
8    * net.sourceforge.servletspy is free software; you can redistribute
9    * it and/or modify it under the terms of the GNU General Public 
10   * License as published by the Free Software Foundation; either 
11   * version 2, or (at your option) any later version.
12   *
13   * net.sourceforge.servletspy is distributed in the hope that it will
14   * be useful, but WITHOUT ANY WARRANTY; without even the implied 
15   * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
16   * See the GNU General Public License for more details.
17   *
18   * You should have received a copy of the GNU General Public License
19   * along with this program; if not, write to the Free Software
20   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA 
21   */
22  
23  package net.sourceforge.servletspy;
24  
25  /***
26   * The <code>IContext</code> describes the context for a subject to node graph
27   * serialization.
28   *
29   * @author arno schumacher
30   */
31  public interface IContext {
32      /*** Passes the serialization task to the next handler. */
33      void proceed();
34  
35      /***
36       * Returns the name of the current serialization task.
37       *
38       * @return The name of the serialization task.
39       */
40      String getName();
41  
42      /***
43       * Returns the current result of the serialization task.
44       *
45       * @return The value
46       */
47      String getValue();
48  
49      /***
50       * Sets the result of the serialization task.
51       *
52       * @param value
53       *            The result
54       */
55      void setValue(final String value);
56  
57      /***
58       * Invalidates the current context. The current result will not be part of
59       * the serialization node graph.
60       */
61      void invalidate();
62  
63      /***
64       * Asks the engine to do a serialization for the provided subject.
65       *
66       * @param name
67       *            The name of subject
68       * @param subject
69       *            The subject to be serialized
70       */
71      void add(final String name, final Object subject);
72  
73      /***
74       * Returns the current subject, the object to be serialized.
75       *
76       * @return The subject.
77       */
78      Object getSubject();
79  
80      /***
81       * Replaces the current subject by the provided object.
82       *
83       * @param object
84       *            The new subject.
85       */
86      void setSubject(final Object object);
87  }