Exemplo n.º 1
0
 /**
  * Returns the plugin settings list for the profile whose name is input
  *
  * @param profileName the name of the profile whose settings you want to retrieve
  * @return the ArrayList of PluginSettings of the profile
  * @throws NoSuchElementException if the profile name is not found
  */
 public ArrayList<PluginSetting> getProfile(String profileString) throws NoSuchElementException {
   if (profileString == null) {
     throw new NoSuchElementException();
   }
   String profileName = null;
   String pageName = "";
   String[] profileStrings = profileString.split("[.]");
   if (profileStrings.length == 1) {
     profileName = profileStrings[0];
   } else if (profileStrings.length == 2) {
     pageName = profileStrings[0];
     profileName = profileStrings[1];
   } else {
     throw new NoSuchElementException("Incorrect Syntax in EMML Tag: " + profileString);
   }
   for (EMMLProfile profile : profileList) {
     if (profileName.equalsIgnoreCase(profile.getProfileName())
         && pageName.equalsIgnoreCase(profile.getPageName())) {
       return profile.getSettings();
     }
   }
   throw new NoSuchElementException(
       "Profile Not Found: "
           + profileString); // If we don't have the profile with the name of the input variable
 }