01: /*
02: * Copyright 2004,2005 The Apache Software Foundation.
03: * Copyright 2006 International Business Machines Corp.
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * 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: package org.apache.axis2.jaxws.description.impl;
18:
19: import org.apache.axis2.jaxws.description.AttachmentType;
20: import org.apache.commons.logging.Log;
21: import org.apache.commons.logging.LogFactory;
22:
23: public class AttachmentDescriptionImpl implements
24: org.apache.axis2.jaxws.description.AttachmentDescription {
25:
26: private static final Log log = LogFactory
27: .getLog(AttachmentDescriptionImpl.class);
28:
29: private AttachmentType attachmentType;
30: private String[] mimeTypes;
31:
32: /**
33: * @param attachmentType
34: * @param mimeTypes
35: */
36: public AttachmentDescriptionImpl(AttachmentType attachmentType,
37: String[] mimeTypes) {
38: this .attachmentType = attachmentType;
39: this .mimeTypes = mimeTypes;
40: if (log.isDebugEnabled()) {
41: String debugString = toString();
42: log.debug("Created AttachmentDescriptionImpl");
43: log.debug(debugString);
44: }
45: }
46:
47: public AttachmentType getAttachmentType() {
48: return attachmentType;
49: }
50:
51: public String[] getMimeTypes() {
52: return mimeTypes;
53: }
54:
55: public String toString() {
56: final String newline = "\n";
57: final String sameline = "; ";
58: StringBuffer string = new StringBuffer();
59:
60: string.append(super .toString());
61: string.append(newline);
62: string.append(" Attachment Type: " + getAttachmentType());
63: //
64: string.append(newline);
65: string.append(" Mime Types: " + getMimeTypes());
66: return string.toString();
67: }
68:
69: }
|