View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  package com.eviware.soapui.impl.wsdl.support.xsd;
13  
14  import java.util.ArrayList;
15  import java.util.Collection;
16  import java.util.List;
17  
18  import javax.xml.namespace.QName;
19  
20  import com.eviware.soapui.SoapUI;
21  import com.eviware.soapui.support.types.StringList;
22  
23  public class SettingUtils
24  {
25     public static Collection<? extends QName> string2QNames(String excluded)
26     {
27        List<QName> result = new ArrayList<QName>();
28        if( excluded != null && excluded.trim().length() > 0 )
29        {
30           try
31           {
32              StringList names = StringList.fromXml( excluded );
33              for( String name : names )
34              {
35                 int ix = name.indexOf( '@' );
36                 if(ix >= 0)
37                    result.add( new QName( name.substring( ix+1 ), name.substring( 0, ix )));
38                 else
39                    result.add( new QName( name ) );
40              }
41           }
42           catch( Exception e )
43           {
44              SoapUI.logError( e );
45           }
46        }
47        
48        return result;
49     }
50  }