View Javadoc

1   /*
2    * Copyright 2003,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.geronimo.ews.ws4j2ee.context.webservices.server.xmlbeans;
17  
18  import com.sun.java.xml.ns.j2Ee.XsdStringType;
19  
20  /***
21   * @author Srinath Perera(hemapani@opensource.lk)
22   */
23  public class XMLBeansUtils {
24      public static String getStringValue(XsdStringType[] invalue) {
25          if (invalue.length > 0) {
26              return invalue[0].getStringValue();
27          } else {
28              return null;
29          }
30      }
31  
32      public static String getStringValue(com.sun.java.xml.ns.j2Ee.String[] invalue) {
33          if (invalue.length > 0) {
34              return invalue[0].getStringValue();
35          } else {
36              return null;
37          }
38      }
39  
40      public static String getStringValue(com.sun.java.xml.ns.j2Ee.String invalue) {
41          if (invalue != null) {
42              return invalue.getStringValue();
43          } else {
44              return null;
45          }
46      }
47  
48      public static String getStringValue(XsdStringType invalue) {
49          if (invalue != null) {
50              return invalue.getStringValue();
51          } else {
52              return null;
53          }
54      }
55  
56  }