01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.jetspeed.serializer.objects;
19:
20: import javolution.xml.XMLFormat;
21: import javolution.xml.stream.XMLStreamException;
22:
23: public class JSProcessOrder {
24: private JSMimeTypes ordererList;
25:
26: public JSProcessOrder() {
27: }
28:
29: /***************************************************************************
30: * SERIALIZER
31: */
32: private static final XMLFormat XML = new XMLFormat(
33: JSProcessOrder.class) {
34:
35: public void write(Object o, OutputElement xml)
36: throws XMLStreamException {
37:
38: try {
39: JSProcessOrder g = (JSProcessOrder) o;
40: xml.add(g.getMimeTypes());
41:
42: } catch (Exception e) {
43: e.printStackTrace();
44: }
45: }
46:
47: public void read(InputElement xml, Object o) {
48: try {
49: JSProcessOrder g = (JSProcessOrder) o;
50: while (xml.hasNext()) {
51: Object o1 = xml.getNext(); // mime
52:
53: if (o1 instanceof JSMimeTypes)
54: g.ordererList = (JSMimeTypes) o1;
55: }
56: } catch (Exception e) {
57: e.printStackTrace();
58: }
59: }
60: };
61:
62: /**
63: * @return Returns the mimeTypes.
64: */
65: public JSMimeTypes getMimeTypes() {
66: return ordererList;
67: }
68:
69: /**
70: * @param mimeTypes
71: * The mimeTypes to set.
72: */
73: public void setMimeTypes(JSMimeTypes ordererList) {
74: this.ordererList = ordererList;
75: }
76:
77: }
|