/** * Method writeActivationProperty. * * @param activationProperty * @param serializer * @param tagName * @throws java.io.IOException */ private void writeActivationProperty( ActivationProperty activationProperty, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( activationProperty.getName() != null ) { serializer.startTag( NAMESPACE, "name" ).text( activationProperty.getName() ).endTag( NAMESPACE, "name" ); } if ( activationProperty.getValue() != null ) { serializer.startTag( NAMESPACE, "value" ).text( activationProperty.getValue() ).endTag( NAMESPACE, "value" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeActivationProperty( ActivationProperty, String, XmlSerializer )
ActivationProperty activationProperty = new ActivationProperty(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) activationProperty.setName( interpolatedTrimmed( parser.nextText(), "name" ) ); activationProperty.setValue( interpolatedTrimmed( parser.nextText(), "value" ) );
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.setName(PROPERTY_PROFILE); prop.setValue("true"); //NOI18N act.setProperty(prop); privateProfile.setActivation(act);
/** * Method updateActivationProperty. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateActivationProperty(ActivationProperty value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null); findAndReplaceSimpleElement(innerCount, root, "value", value.getValue(), null); } } //-- void updateActivationProperty(ActivationProperty, String, Counter, Element)
/** * Method updateActivationProperty * * @param value * @param element * @param counter * @param xmlTag */ protected void updateActivationProperty(ActivationProperty value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null); findAndReplaceSimpleElement(innerCount, root, "value", value.getValue(), null); } } //-- void updateActivationProperty(ActivationProperty, String, Counter, Element)