You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by un...@apache.org on 2003/10/23 18:57:57 UTC
cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl XPathSourceInspector.java
unico 2003/10/23 09:57:57
Modified: src/blocks/repository/java/org/apache/cocoon/components/source/impl
XPathSourceInspector.java
Log:
add method getExposedSourcePropertyTypes(), improve documentation
Revision Changes Path
1.2 +30 -8 cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/XPathSourceInspector.java
Index: XPathSourceInspector.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/XPathSourceInspector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XPathSourceInspector.java 22 Oct 2003 18:53:06 -0000 1.1
+++ XPathSourceInspector.java 23 Oct 2003 16:57:57 -0000 1.2
@@ -78,10 +78,29 @@
public class XPathSourceInspector extends AbstractLogEnabled implements
SourceInspector, ThreadSafe, Parameterizable {
- private String propertynamespace = "http://apache.org/cocoon/inspector/xpath/1.0";
- private String propertyname = "result";
- private String extension = null;
- private String xpath = null;
+ /**
+ * The default namespace uri of the property
+ * exposed by this SourceInspector.
+ * <p>
+ * The value is <code>http://apache.org/cocoon/inspector/xpath/1.0</code> .
+ * </p>
+ */
+ public static final String DEFAULT_PROPERTY_NS =
+ "http://apache.org/cocoon/inspector/xpath/1.0";
+
+ /**
+ * The default property name exposed by this
+ * SourceInspector.
+ * <p>
+ * The value is <code>result</code> .
+ * </p>
+ */
+ public static final String DEFAULT_PROPERTY_NAME = "result";
+
+ private String propertynamespace;
+ private String propertyname;
+ private String extension;
+ private String xpath;
private ComponentManager manager = null;
@@ -90,9 +109,8 @@
}
public void parameterize(Parameters params) {
- this.propertynamespace = params.getParameter("namespace",
- "http://apache.org/cocoon/inspector/xpath/1.0");
- this.propertyname = params.getParameter("name", "result");
+ this.propertynamespace = params.getParameter("namespace", DEFAULT_PROPERTY_NS);
+ this.propertyname = params.getParameter("name", DEFAULT_PROPERTY_NAME);
this.extension = params.getParameter("extension", ".xml");
this.xpath = params.getParameter("xpath", "/*");
}
@@ -150,6 +168,10 @@
if (property!=null)
return new SourceProperty[]{property};
return null;
+ }
+
+ public String[] getExposedSourcePropertyTypes() {
+ return new String[] {propertynamespace + "#" + propertyname};
}
}