Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-12-23 22:59:27 +0000
committerslewis2007-12-23 22:59:27 +0000
commit68758e30290f0452f836370775133942ae809f1f (patch)
tree2e6a6046473b1fe4166e1d7a388277afca419bdd
parent82d065903f5d31293b6e7a5e157eac15367d9311 (diff)
downloadorg.eclipse.ecf-68758e30290f0452f836370775133942ae809f1f.tar.gz
org.eclipse.ecf-68758e30290f0452f836370775133942ae809f1f.tar.xz
org.eclipse.ecf-68758e30290f0452f836370775133942ae809f1f.zip
Added javadocs and test cases for file transfer
-rw-r--r--incubation/bundles/org.eclipse.ecf.bulletinboard.commons/src/org/eclipse/ecf/internal/bulletinboard/commons/parsing/GenericParser.java32
1 files changed, 12 insertions, 20 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.bulletinboard.commons/src/org/eclipse/ecf/internal/bulletinboard/commons/parsing/GenericParser.java b/incubation/bundles/org.eclipse.ecf.bulletinboard.commons/src/org/eclipse/ecf/internal/bulletinboard/commons/parsing/GenericParser.java
index 3b84c04d5..7da4824fd 100644
--- a/incubation/bundles/org.eclipse.ecf.bulletinboard.commons/src/org/eclipse/ecf/internal/bulletinboard/commons/parsing/GenericParser.java
+++ b/incubation/bundles/org.eclipse.ecf.bulletinboard.commons/src/org/eclipse/ecf/internal/bulletinboard/commons/parsing/GenericParser.java
@@ -25,9 +25,9 @@ import org.eclipse.ecf.internal.bulletinboard.commons.util.StringUtil;
public class GenericParser {
- private Namespace namespace;
+ private final Namespace namespace;
- private URL baseURL;
+ private final URL baseURL;
public GenericParser(Namespace namespace, URL baseURL) {
super();
@@ -35,24 +35,16 @@ public class GenericParser {
this.baseURL = baseURL;
}
- public IBBObject parseSingleIdName(IPatternDescriptor pattern,
- CharSequence sequence, IBBObjectFactory factory) {
- return (IBBObject) parseIdNamePairs(pattern, sequence, factory, false,
- false);
+ public IBBObject parseSingleIdName(IPatternDescriptor pattern, CharSequence sequence, IBBObjectFactory factory) {
+ return (IBBObject) parseIdNamePairs(pattern, sequence, factory, false, false);
}
- @SuppressWarnings("unchecked")
- public Map<ID, IBBObject> parseMultiIdName(IPatternDescriptor pattern,
- CharSequence sequence, IBBObjectFactory factory,
- boolean preserveOrder) {
- return (Map<ID, IBBObject>) parseIdNamePairs(pattern, sequence,
- factory, true, preserveOrder);
+ public Map<ID, IBBObject> parseMultiIdName(IPatternDescriptor pattern, CharSequence sequence, IBBObjectFactory factory, boolean preserveOrder) {
+ return (Map<ID, IBBObject>) parseIdNamePairs(pattern, sequence, factory, true, preserveOrder);
}
- private Object parseIdNamePairs(IPatternDescriptor pattern,
- CharSequence sequence, IBBObjectFactory factory,
- boolean expectMultipleMatches, boolean preserveOrder) {
- Matcher m = pattern.getPattern().matcher(sequence);
+ private Object parseIdNamePairs(IPatternDescriptor pattern, CharSequence sequence, IBBObjectFactory factory, boolean expectMultipleMatches, boolean preserveOrder) {
+ final Matcher m = pattern.getPattern().matcher(sequence);
Map<ID, IBBObject> objectMap = null;
if (expectMultipleMatches) {
if (preserveOrder) {
@@ -62,16 +54,16 @@ public class GenericParser {
}
}
while (m.find()) {
- Map<String, Object> values = pattern.getValueMap(m);
+ final Map<String, Object> values = pattern.getValueMap(m);
ID id = null;
try {
id = factory.createBBObjectId(namespace, baseURL, (String) values.get(IPatternDescriptor.ID_PARAM));
- } catch (IDCreateException e) {
+ } catch (final IDCreateException e) {
// TODO autogen e
e.printStackTrace();
}
- String name = StringUtil.stripHTMLTrim((String) values.get(IPatternDescriptor.NAME_PARAM));
- IBBObject obj = factory.createBBObject(id, new String(name), values);
+ final String name = StringUtil.stripHTMLTrim((String) values.get(IPatternDescriptor.NAME_PARAM));
+ final IBBObject obj = factory.createBBObject(id, new String(name), values);
if (expectMultipleMatches) {
objectMap.put(id, obj);
} else {

Back to the top