diff options
author | David A. Madore <david+git@madore.org> | 2011-08-28 19:52:02 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2011-08-28 19:52:02 +0200 |
commit | 3b1023c45a919f25ef38c080f2ac2c0dc5d5e7ca (patch) | |
tree | 109f659090d4f08bc11f8da0f16fbff364dbbf9a /org/madore/damlengine/TodoEntryElement.java | |
parent | 9c54e57c4a2e7029d8dbcd65ae63353135a18401 (diff) | |
download | damlengine-3b1023c45a919f25ef38c080f2ac2c0dc5d5e7ca.tar.gz damlengine-3b1023c45a919f25ef38c080f2ac2c0dc5d5e7ca.tar.bz2 damlengine-3b1023c45a919f25ef38c080f2ac2c0dc5d5e7ca.zip |
(Preliminary) handling of weblog entry selection and summary.
Diffstat (limited to 'org/madore/damlengine/TodoEntryElement.java')
-rw-r--r-- | org/madore/damlengine/TodoEntryElement.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/org/madore/damlengine/TodoEntryElement.java b/org/madore/damlengine/TodoEntryElement.java index 8b38881..78bffd1 100644 --- a/org/madore/damlengine/TodoEntryElement.java +++ b/org/madore/damlengine/TodoEntryElement.java @@ -24,7 +24,8 @@ public final class TodoEntryElement extends TodoDefaultElement { @Override public void handleNodeOnly() { - if ( ! ( caller instanceof TodoWeblogElement ) ) + if ( ! ( caller instanceof TodoWeblogElement + || caller instanceof TodoWeblogSelectElement ) ) throw new IllegalArgumentException("entry node can only be child of weblog node"); Element div = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "div"); @@ -35,11 +36,11 @@ public final class TodoEntryElement extends TodoDefaultElement { String entryNumberStr = node.getAttributeNS(null, "number"); if ( ! Pattern.matches("^\\d{4}$", entryNumberStr) ) - throw new IllegalArgumentException("title number attribute must be of the form NNNN"); + throw new IllegalArgumentException("entry number attribute must be of the form NNNN"); String entryDateStr = node.getAttributeNS(null, "date"); Matcher entryDateMatcher = Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})$").matcher(entryDateStr); if ( ! entryDateMatcher.matches() ) - throw new IllegalArgumentException("title date attribute must be of the form YYYY-MM-DD"); + throw new IllegalArgumentException("entry date attribute must be of the form YYYY-MM-DD"); String entryYearStr = entryDateMatcher.group(1); String entryMonthStr = entryDateMatcher.group(2); String entryDayStr = entryDateMatcher.group(3); |