Back to project page masa.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...
If you think the Android project masa listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.jvending.masa; // w w w . ja va 2 s . co m import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.codehaus.plexus.util.xml.Xpp3Dom; public final class ApplicationRequirements { private final Xpp3Dom dom; public ApplicationRequirements( Xpp3Dom dom ) { if ( dom == null ) { throw new IllegalArgumentException( "dom: null" ); } this.dom = dom; } public List<String> getLanguages() { Xpp3Dom lang = dom.getChild( "languages" ); return ( lang != null ) ? Arrays.asList( lang.getValue().split( "," ) ) : new ArrayList<String>(); } public boolean matches( String[] qualifiers ) { if ( qualifiers == null || qualifiers.length == 0 ) { return true; } List<String> all = new ArrayList<String>(); all.addAll( getLanguages() ); for ( String qualifier : qualifiers ) { if ( !all.contains( qualifier ) ) { return false; } } return true; } }