/** * Method addProperty. * * @param key * @param value */ public void addProperty( String key, String value ) { getProperties().put( key, value ); } //-- void addProperty( String, String )
/** * Method removePluginRepository. * * @param repository */ public void removePluginRepository( Repository repository ) { getPluginRepositories().remove( repository ); } //-- void removePluginRepository( Repository )
/** * Method removeRepository. * * @param repository */ public void removeRepository( Repository repository ) { getRepositories().remove( repository ); } //-- void removeRepository( Repository )
if ( profile.getId() != null ) serializer.startTag( NAMESPACE, "id" ).text( profile.getId() ).endTag( NAMESPACE, "id" ); if ( profile.getActivation() != null ) writeActivation( (Activation) profile.getActivation(), "activation", serializer ); if ( ( profile.getProperties() != null ) && ( profile.getProperties().size() > 0 ) ) for ( Iterator iter = profile.getProperties().keySet().iterator(); iter.hasNext(); ) String value = (String) profile.getProperties().get( key ); serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" ); if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) ) for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); ) if ( ( profile.getPluginRepositories() != null ) && ( profile.getPluginRepositories().size() > 0 ) ) for ( Iterator iter = profile.getPluginRepositories().iterator(); iter.hasNext(); )
Profile profile = new Profile(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) profile.setId( interpolatedTrimmed( parser.nextText(), "id" ) ); profile.setActivation( parseActivation( parser, strict ) ); profile.addProperty( key, value ); profile.setRepositories( repositories ); while ( parser.nextTag() == XmlPullParser.START_TAG ) profile.setPluginRepositories( pluginRepositories ); while ( parser.nextTag() == XmlPullParser.START_TAG )
while (it.hasNext()) { org.apache.maven.profiles.Profile profile = (org.apache.maven.profiles.Profile) it.next(); if (PROFILE_PRIVATE.equals(profile.getId())) { privateProfile = profile; break; privateProfile = new org.apache.maven.profiles.Profile(); privateProfile.setId(PROFILE_PRIVATE); org.apache.maven.profiles.Activation act = new org.apache.maven.profiles.Activation(); org.apache.maven.profiles.ActivationProperty prop = new org.apache.maven.profiles.ActivationProperty(); prop.setValue("true"); //NOI18N act.setProperty(prop); privateProfile.setActivation(act); profiles.addProfile(privateProfile); markAsModified(profiles); return new org.apache.maven.profiles.Profile();
private static void extractProfiles(Set<String> profileIds, File file) { extractProfilesFromModelLineage(file, profileIds); File basedir = FileUtil.normalizeFile(file.getParentFile()); FileObject fileObject = FileUtil.toFileObject(basedir); //read from profiles.xml Iterator it2 = MavenSettingsSingleton.createProfilesModel(fileObject).getProfiles().iterator(); while (it2.hasNext()) { org.apache.maven.profiles.Profile prof = (org.apache.maven.profiles.Profile) it2.next(); profileIds.add(prof.getId()); } }
profile.setId( profileXmlProfile.getId() ); org.apache.maven.profiles.Activation profileActivation = profileXmlProfile.getActivation(); profile.setProperties( profileXmlProfile.getProperties() ); List repos = profileXmlProfile.getRepositories(); if ( repos != null ) List pluginRepos = profileXmlProfile.getPluginRepositories(); if ( pluginRepos != null )
/** * Method updateProfile. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null); updateActivation( value.getActivation(), "activation", innerCount, root); findAndReplaceProperties(innerCount, root, "properties", value.getProperties()); iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository"); iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository"); } //-- void updateProfile(Profile, String, Counter, Element)
public Boolean getValue() { Profile prof = handle.getNetbeansPrivateProfile(false); if (prof != null && prof.getProperties().getProperty(Constants.HINT_USE_EXTERNAL) != null) { return Boolean.valueOf(prof.getProperties().getProperty(Constants.HINT_USE_EXTERNAL)); } String val = handle.getPOMModel().getProperties().getProperty(Constants.HINT_USE_EXTERNAL); if (val != null) { return Boolean.valueOf(val); } return null; }
/** * Method addRepository. * * @param repository */ public void addRepository( Repository repository ) { getRepositories().add( repository ); } //-- void addRepository( Repository )
/** * Method addPluginRepository. * * @param repository */ public void addPluginRepository( Repository repository ) { getPluginRepositories().add( repository ); } //-- void addPluginRepository( Repository )
/** * Method updateProfile * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null); updateActivation( value.getActivation(), "activation", innerCount, root); findAndReplaceProperties(innerCount, root, "properties", value.getProperties()); iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository"); iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository"); } //-- void updateProfile(Profile, String, Counter, Element)
public void setValue(Boolean value) { Profile prof = handle.getNetbeansPrivateProfile(false); if (prof != null && prof.getProperties().getProperty(Constants.HINT_USE_EXTERNAL) != null) { prof.getProperties().setProperty(Constants.HINT_USE_EXTERNAL, value == null ? "false" : value.toString()); handle.markAsModified(handle.getProfileModel()); return; } if (value == null || value.booleanValue() == false) { Boolean proj = getProjectValue(); if (proj != null && proj.equals(Boolean.TRUE)) { handle.getPOMModel().addProperty(Constants.HINT_USE_EXTERNAL, "false"); //NOI18N } else { handle.getPOMModel().getProperties().remove(Constants.HINT_USE_EXTERNAL); } } else { handle.getPOMModel().addProperty(Constants.HINT_USE_EXTERNAL, "true"); //NOI18N } handle.markAsModified(handle.getPOMModel()); }