KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > processor > access > Get


1 package org.apache.slide.projector.processor.access;
2
3 import org.apache.slide.projector.Context;
4 import org.apache.slide.projector.Projector;
5 import org.apache.slide.projector.URI;
6 import org.apache.slide.projector.descriptor.ParameterDescriptor;
7 import org.apache.slide.projector.descriptor.ResultEntryDescriptor;
8 import org.apache.slide.projector.descriptor.URIValueDescriptor;
9 import org.apache.slide.projector.i18n.DefaultMessage;
10 import org.apache.slide.projector.i18n.ParameterMessage;
11 import org.apache.slide.projector.processor.SimpleProcessor;
12 import org.apache.slide.projector.value.URIValue;
13 import org.apache.slide.projector.value.Value;
14
15 public class Get extends SimpleProcessor {
16     public Value process(Value input, Context context) throws Exception JavaDoc {
17         URI uri = new URIValue(input.toString());
18         return Projector.getRepository().getResource(uri, context.getCredentials());
19     }
20
21     public ParameterDescriptor getParameterDescriptor() {
22         return new ParameterDescriptor(INPUT, new ParameterMessage("simpleProcessor/parameter/input"), new URIValueDescriptor());
23     }
24
25     public ResultEntryDescriptor getResultEntryDescriptor() {
26         return new ResultEntryDescriptor(OUTPUT, new DefaultMessage("simpleProcessor/result/output"), "*", true);
27     }
28 }
Popular Tags