You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2008/07/23 07:21:04 UTC
svn commit: r678995 -
/cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/node/MatchNode.java
Author: reinhard
Date: Tue Jul 22 22:21:04 2008
New Revision: 678995
URL: http://svn.apache.org/viewvc?rev=678995&view=rev
Log:
. minor improvements on javadocs and comments
Modified:
cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/node/MatchNode.java
Modified: cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/node/MatchNode.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/node/MatchNode.java?rev=678995&r1=678994&r2=678995&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/node/MatchNode.java (original)
+++ cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/node/MatchNode.java Tue Jul 22 22:21:04 2008
@@ -88,10 +88,11 @@
testValue = invocation.getRequestURI();
}
+ // create the matching context based on the used matching attributes (regexp, equals, etc.)
this.matcherContext = this.lookupMatcherContext();
- // if there are NO matching attributes (regexp, equals, ...) set, execute the children
if (this.matcherContext == null) {
- throw new RuntimeException("Error!");
+ throw new RuntimeException(
+ "Use on of the matching attributes: wildcard, equals, regexp, starts-with, ends-with, contains");
}
// invoke the matcher and execute the children afterwards
@@ -116,6 +117,10 @@
return InvocationResult.NONE;
}
+ /**
+ * Find out what matching attribute (pattern, wildcard, equals, etc.) is used, check that it's not more than one
+ * that is used and throw an exception otherwise.
+ */
protected MatcherContext lookupMatcherContext() {
// determine the matching type and check if there are conflicting match attributes
LinkedList<MatcherContext> matcherContextList = new LinkedList<MatcherContext>();