コード例 #1
0
 /**
  * Get the feature by its unique id.
  *
  * @param id The id of the feature.
  * @return The feature by its id or null if no feature found by given id.
  */
 public Feature getFeatureById(final int id) {
   for (final Feature feature : mFeatures) {
     if (feature.getId() == id) {
       return feature;
     }
   }
   return null;
 }
コード例 #2
0
ファイル: ProfileGenMojo.java プロジェクト: ww102111/tools
  private String getIUsToInstall() throws MojoExecutionException {
    String installUIs = "";
    for (Object featureObj : features) {
      Feature f;
      if (featureObj instanceof Feature) {
        f = (Feature) featureObj;
      } else if (featureObj instanceof String) {
        f = Feature.getFeature(featureObj.toString());
      } else f = (Feature) featureObj;
      installUIs = installUIs + f.getId().trim() + "/" + f.getVersion().trim() + ",";
    }

    if (installUIs.length() == 0) {
      installUIs = installUIs.substring(0, installUIs.length() - 1);
    }
    return installUIs;
  }