Last change
on this file since 1911 was
1911,
checked in by oschonef, 12 years ago
|
- first round of major refactoring to simply the provider
- result sets converted to iterator/cursor-mode (better streaming support)
- delegate serializing of records to Result and ResultList?
- prepare getting rid of over-engineered and complicated MetadataFormats? classes (not done, yet)
HEADS UP: breaks existing API
|
-
Property svn:eol-style set to
native
|
File size:
1010 bytes
|
Line | |
---|
1 | package eu.clarin.oai.provider.ext; |
---|
2 | |
---|
3 | import java.io.IOException; |
---|
4 | |
---|
5 | import javax.xml.stream.XMLStreamException; |
---|
6 | |
---|
7 | import org.slf4j.Logger; |
---|
8 | import org.slf4j.LoggerFactory; |
---|
9 | |
---|
10 | import eu.clarin.oai.provider.OAIException; |
---|
11 | |
---|
12 | public abstract class Verb { |
---|
13 | protected static final Logger logger = LoggerFactory.getLogger(Verb.class); |
---|
14 | |
---|
15 | public abstract String getName(); |
---|
16 | |
---|
17 | public abstract Argument[] getArguments(); |
---|
18 | |
---|
19 | public abstract void process(VerbContext ctx) throws IOException, |
---|
20 | XMLStreamException, OAIException; |
---|
21 | |
---|
22 | public final boolean supportsArgument(String name) { |
---|
23 | return getArgument(name) != null; |
---|
24 | } |
---|
25 | |
---|
26 | public final Argument getArgument(String name) { |
---|
27 | final Argument[] arguments = getArguments(); |
---|
28 | if (arguments != null) { |
---|
29 | for (Argument argument : arguments) { |
---|
30 | if (argument.getName().equals(name)) { |
---|
31 | return argument; |
---|
32 | } |
---|
33 | } |
---|
34 | } |
---|
35 | return null; |
---|
36 | } |
---|
37 | |
---|
38 | } // abstract class Verb |
---|
Note: See
TracBrowser
for help on using the repository browser.