KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > magnet > domain > Include


1 package org.sapia.magnet.domain;
2
3 // Import of Sapia's magnet classes
4
// --------------------------------
5
import org.sapia.magnet.render.AbstractRenderable;
6 import org.sapia.magnet.render.MagnetContext;
7 import org.sapia.magnet.render.RenderingException;
8
9
10 /**
11  *
12  *
13  * @author Jean-Cedric Desrochers
14  *
15  * <dl>
16  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
17  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
18  * <a HREF="http://www.sapia-oss.org/license.html" target="sapia-license">license page</a> at the Sapia OSS web site</dd></dt>
19  * </dl>
20  */

21 public class Include extends AbstractRenderable {
22
23   /////////////////////////////////////////////////////////////////////////////////////////
24
///////////////////////////////// INSTANCE ATTRIBUTES /////////////////////////////////
25
/////////////////////////////////////////////////////////////////////////////////////////
26

27   /** The pattern of this include. */
28   private String JavaDoc _thePattern;
29
30   /////////////////////////////////////////////////////////////////////////////////////////
31
//////////////////////////////////// CONSTRUCTORS /////////////////////////////////////
32
/////////////////////////////////////////////////////////////////////////////////////////
33

34   /**
35    * Creates a new Include instance.
36    */

37   public Include() {
38   }
39
40   /**
41    * Creates a new Include instance with the passed in argument.
42    *
43    * @param aPattern The pattern of this include.
44    */

45   public Include(String JavaDoc aPattern) {
46     _thePattern = aPattern;
47   }
48
49   /////////////////////////////////////////////////////////////////////////////////////////
50
////////////////////////////////// ACCESSOR METHODS ///////////////////////////////////
51
/////////////////////////////////////////////////////////////////////////////////////////
52

53   /**
54    * Returns the pattern of this include.
55    *
56    * @return The pattern of this include.
57    */

58   public String JavaDoc getPattern() {
59     return _thePattern;
60   }
61
62   /////////////////////////////////////////////////////////////////////////////////////////
63
/////////////////////////////////// MUTATOR METHODS ///////////////////////////////////
64
/////////////////////////////////////////////////////////////////////////////////////////
65

66   /**
67    * Changes the pattern of this include.
68    *
69    * @param aPattern The new pattern of this include.
70    */

71   public void setPattern(String JavaDoc aPattern){
72     _thePattern = aPattern;
73   }
74
75   /////////////////////////////////////////////////////////////////////////////////////////
76
////////////////////////////////// OVERRIDEN METHODS //////////////////////////////////
77
/////////////////////////////////////////////////////////////////////////////////////////
78

79   /**
80    * Renders this objects to the magnet context passed in.
81    *
82    * @param aContext The magnet context to use.
83    * @exception RenderingException If an error occurs while rendering this object.
84    */

85   public void render(MagnetContext aContext) throws RenderingException {
86     _thePattern = resolveValue(aContext, _thePattern);
87   }
88
89   /**
90    * Returns a string representation of this include.
91    *
92    * @return A string representation of this include.
93    */

94   public String JavaDoc toString() {
95     StringBuffer JavaDoc aBuffer = new StringBuffer JavaDoc(super.toString());
96     aBuffer.append("[pattern=").append(_thePattern).
97             append("]");
98
99     return aBuffer.toString();
100   }
101 }
102
Popular Tags