You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/08/22 11:29:56 UTC
cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core ImportTag.java
jstrachan 2002/08/22 02:29:55
Modified: jelly/src/java/org/apache/commons/jelly/tags/core
ImportTag.java
Log:
Patch to make the import tag use proper Java Bean property naming conventions and to correctly use the boolean type getter and setter.
This could fix bug...
http://jira.werken.com/secure/ViewIssue.jspa?key=JELLY-5
Revision Changes Path
1.2 +23 -36 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/ImportTag.java
Index: ImportTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/ImportTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ImportTag.java 5 Jun 2002 18:03:38 -0000 1.1
+++ ImportTag.java 22 Aug 2002 09:29:55 -0000 1.2
@@ -64,14 +64,8 @@
import java.net.URL;
-import org.apache.commons.jelly.JellyContext;
-
import org.apache.commons.jelly.MissingAttributeException;
-
-import org.apache.commons.jelly.Script;
-
import org.apache.commons.jelly.TagSupport;
-
import org.apache.commons.jelly.XMLOutput;
/** Imports another script.
@@ -89,53 +83,46 @@
public class ImportTag extends TagSupport {
private String uri;
-
- private boolean shouldInherit;
+ private boolean inherit;
public ImportTag() {
- this.shouldInherit = false;
- }
-
- public void setInherit(String inherit) {
- if ( "true".equals( inherit ) ) {
- this.shouldInherit = true;
- }
- }
-
- public boolean getInherit() {
- return this.shouldInherit;
}
// Tag interface
-
//-------------------------------------------------------------------------
-
public void doTag(XMLOutput output) throws Exception {
-
if (uri == null) {
-
throw new MissingAttributeException( "uri" );
-
}
// we need to create a new JellyContext of the URI
-
// take off the script name from the URL
-
- context.runScript(uri, output, true, getInherit() );
+ context.runScript(uri, output, true, isInherit() );
}
// Properties
-
//-------------------------------------------------------------------------
- /** Sets the URI (relative URI or absolute URL) for the script to evaluate. */
+ /**
+ * @return whether property inheritence is enabled
+ */
+ public boolean isInherit() {
+ return inherit;
+ }
- public void setUri(String uri) {
+ /**
+ * Sets whether property inheritence is enabled or disabled
+ */
+ public void setInherit(boolean inherit) {
+ this.inherit = inherit;
+ }
+ /**
+ * Sets the URI (relative URI or absolute URL) for the script to evaluate.
+ */
+ public void setUri(String uri) {
this.uri = uri;
-
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>