From 67e7f42714491fdacaacc3b26f9830a2e8c0f71b Mon Sep 17 00:00:00 2001 From: Andrea Aime Date: Sun, 15 Jan 2006 16:49:00 +0000 Subject: [PATCH] "@match class" changes and some feedback on why we skip incorrect @match specifications --- src/gr/spinellis/umlgraph/doclet/View.java | 13 ++++++++++++- src/org/umlgraph/doclet/View.java | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/gr/spinellis/umlgraph/doclet/View.java b/src/gr/spinellis/umlgraph/doclet/View.java index d987b23..778774d 100644 --- a/src/gr/spinellis/umlgraph/doclet/View.java +++ b/src/gr/spinellis/umlgraph/doclet/View.java @@ -61,12 +61,23 @@ class View implements OptionProvider { globalOptions = new ArrayList(); for (int i = 0; i < tags.length; i++) { if (tags[i].name().equals("@match")) { + // store the current pattern and its options if (currPattern != null) { String[][] options = patternOptions .toArray(new String[patternOptions.size()][]); optionOverrides.put(Pattern.compile(currPattern), options); } - currPattern = tags[i].text(); + // start gathering data for the new patters + String[] strings = StringUtil.tokenize(tags[i].text()); + if(strings.length < 2) { + System.err.println("Skipping uncomplete @match tag, type missing. "); + currPattern = null; + } else if(!strings[0].equals("class")) { + System.err.println("Skipping @match tag, unknown match type (only 'class' is supported for the moment). "); + currPattern = null; + } else { + currPattern = strings[1]; + } patternOptions.clear(); } else if (tags[i].name().equals("@opt")) { String[] opts = StringUtil.tokenize(tags[i].text()); diff --git a/src/org/umlgraph/doclet/View.java b/src/org/umlgraph/doclet/View.java index d987b23..778774d 100644 --- a/src/org/umlgraph/doclet/View.java +++ b/src/org/umlgraph/doclet/View.java @@ -61,12 +61,23 @@ class View implements OptionProvider { globalOptions = new ArrayList(); for (int i = 0; i < tags.length; i++) { if (tags[i].name().equals("@match")) { + // store the current pattern and its options if (currPattern != null) { String[][] options = patternOptions .toArray(new String[patternOptions.size()][]); optionOverrides.put(Pattern.compile(currPattern), options); } - currPattern = tags[i].text(); + // start gathering data for the new patters + String[] strings = StringUtil.tokenize(tags[i].text()); + if(strings.length < 2) { + System.err.println("Skipping uncomplete @match tag, type missing. "); + currPattern = null; + } else if(!strings[0].equals("class")) { + System.err.println("Skipping @match tag, unknown match type (only 'class' is supported for the moment). "); + currPattern = null; + } else { + currPattern = strings[1]; + } patternOptions.clear(); } else if (tags[i].name().equals("@opt")) { String[] opts = StringUtil.tokenize(tags[i].text());