dion 2004/09/05 07:17:33
Modified: jelly/src/java/org/apache/commons/jelly JellyContext.java
Log:
More docs
Revision Changes Path
1.57 +31 -3
jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java
Index: JellyContext.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- JellyContext.java 5 Sep 2004 14:08:17 -0000 1.56
+++ JellyContext.java 5 Sep 2004 14:17:33 -0000 1.57
@@ -31,7 +31,8 @@
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-/** <p><code>JellyContext</code> represents the Jelly context.</p>
+/**
+ * <p><code>JellyContext</code> represents the Jelly context.</p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision$
@@ -135,17 +136,38 @@
init();
}
+ /**
+ * Create a new context with the given parent context.
+ * The parent's rootURL are set on the child, and the parent's variables are
+ * available in the child context under the name <code>parentScope</code>.
+ *
+ * @param parentJellyContext the parent context for the newly created context.
+ * @param currentURL the root URL used in resolving relative resources
+ */
public JellyContext(JellyContext parentJellyContext, URL currentURL) {
this(parentJellyContext);
this.currentURL = currentURL;
}
+ /**
+ * Create a new context with the given parent context.
+ * The parent's variables are available in the child context under the name
<code>parentScope</code>.
+ *
+ * @param parentJellyContext the parent context for the newly created context.
+ * @param rootURL the root URL used in resolving absolute resources i.e. those
starting with '/'
+ * @param currentURL the root URL used in resolving relative resources
+ */
public JellyContext(JellyContext parentJellyContext, URL rootURL, URL
currentURL) {
this(parentJellyContext, currentURL);
this.rootURL = rootURL;
}
- private void init() {
+ /**
+ * Initialize the context.
+ * This includes adding the context to itself under the name
<code>context</code> and
+ * making the System Properties available as <code>systemScope</code>
+ */
+ private void init() {
variables.put("context",this);
try {
variables.put("systemScope", System.getProperties() );
@@ -255,7 +277,7 @@
- /** Sets the value of the given variable name */
+ /** Sets the value of the named variable */
public void setVariable(String name, Object value) {
if ( isExport() ) {
getParent().setVariable( name, value );
@@ -814,6 +836,9 @@
this.export = export;
}
+ /**
+ * @return whether we should export variable definitions to our parent context
+ */
public boolean isExport() {
return this.export;
}
@@ -825,6 +850,9 @@
this.inherit = inherit;
}
+ /**
+ * @return whether we should inherit variables from our parent context
+ */
public boolean isInherit() {
return this.inherit;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]