protected void mergeLicense_Comments( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getComments(); if ( src != null ) { if ( sourceDominant || target.getComments() == null ) { target.setComments( src ); target.setLocation( "comments", source.getLocation( "comments" ) ); } } }
properties.put( "license." + i + ".name", license.getName() ); properties.put( "license." + i + ".url", license.getUrl() ); properties.put( "license." + i + ".comments", license.getComments() ); properties.put( "license." + i + ".distribution", license.getDistribution() );
public static License cloneLicense( License src ) { if ( src == null ) { return null; } License result = new License(); result.setComments( src.getComments() ); result.setDistribution( src.getDistribution() ); result.setName( src.getName() ); result.setUrl( src.getUrl() ); return result; }
/** * Method writeLicense. * * @param license * @param serializer * @param tagName * @throws java.io.IOException */ private void writeLicense( License license, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( license.getName() != null ) { serializer.startTag( NAMESPACE, "name" ).text( license.getName() ).endTag( NAMESPACE, "name" ); } if ( license.getUrl() != null ) { serializer.startTag( NAMESPACE, "url" ).text( license.getUrl() ).endTag( NAMESPACE, "url" ); } if ( license.getDistribution() != null ) { serializer.startTag( NAMESPACE, "distribution" ).text( license.getDistribution() ).endTag( NAMESPACE, "distribution" ); } if ( license.getComments() != null ) { serializer.startTag( NAMESPACE, "comments" ).text( license.getComments() ).endTag( NAMESPACE, "comments" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeLicense( License, String, XmlSerializer )
/** * Method writeLicense. * * @param license * @param serializer * @param tagName * @throws java.io.IOException */ private void writeLicense( License license, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( license.getName() != null ) { serializer.attribute( NAMESPACE, "name", license.getName() ); } if ( license.getUrl() != null ) { serializer.attribute( NAMESPACE, "url", license.getUrl() ); } if ( license.getDistribution() != null ) { serializer.attribute( NAMESPACE, "distribution", license.getDistribution() ); } if ( license.getComments() != null ) { serializer.attribute( NAMESPACE, "comments", license.getComments() ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeLicense( License, String, XmlSerializer )
protected void mergeLicense_Comments( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getComments(); if ( src != null ) { if ( sourceDominant || target.getComments() == null ) { target.setComments( src ); target.setLocation( "comments", source.getLocation( "comments" ) ); } } }
/** * Equivalent to {@code new ProjectLicense( license.getName(), license.getUrl(), license.getDistribution(), * license.getComments(), null )} * * @param license the license to get name, URL, ditribution and comments from */ public ProjectLicense( License license ) { this( license.getName(), license.getUrl(), license.getDistribution(), license.getComments(), null ); }
properties.put( "license." + i + ".name", license.getName() ); properties.put( "license." + i + ".url", license.getUrl() ); properties.put( "license." + i + ".comments", license.getComments() ); properties.put( "license." + i + ".distribution", license.getDistribution() );
properties.put( "license." + i + ".name", license.getName() ); properties.put( "license." + i + ".url", license.getUrl() ); properties.put( "license." + i + ".comments", license.getComments() ); properties.put( "license." + i + ".distribution", license.getDistribution() );
/** * Adds information about references licenses. * * @param pomDescriptor * The descriptor for the current POM. * @param model * The Maven Model. * @param store * The database. */ private void addLicenses(MavenPomDescriptor pomDescriptor, Model model, Store store) { List<License> licenses = model.getLicenses(); for (License license : licenses) { MavenLicenseDescriptor licenseDescriptor = store.create(MavenLicenseDescriptor.class); licenseDescriptor.setUrl(license.getUrl()); licenseDescriptor.setComments(license.getComments()); licenseDescriptor.setName(license.getName()); licenseDescriptor.setDistribution(license.getDistribution()); pomDescriptor.getLicenses().add(licenseDescriptor); } }
/** * Method updateLicense * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense(License value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null); findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null); findAndReplaceSimpleElement(innerCount, root, "distribution", value.getDistribution(), null); findAndReplaceSimpleElement(innerCount, root, "comments", value.getComments(), null); } //-- void updateLicense(License, String, Counter, Element)
/** * Method updateLicense * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense( License value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null ); findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null ); findAndReplaceSimpleElement( innerCount, root, "distribution", value.getDistribution(), null ); findAndReplaceSimpleElement( innerCount, root, "comments", value.getComments(), null ); } // -- void updateLicense(License, String, Counter, Element)
/** * Method updateLicense. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense(License value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null); findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null); findAndReplaceSimpleElement(innerCount, root, "distribution", value.getDistribution(), null); findAndReplaceSimpleElement(innerCount, root, "comments", value.getComments(), null); } //-- void updateLicense(License, String, Counter, Element)
/** * Method updateLicense. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense( License value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null ); findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null ); findAndReplaceSimpleElement( innerCount, root, "distribution", value.getDistribution(), null ); findAndReplaceSimpleElement( innerCount, root, "comments", value.getComments(), null ); } // -- void updateLicense(License, String, Counter, Element)
/** * Method updateLicense * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense( License value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null ); findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null ); findAndReplaceSimpleElement( innerCount, root, "distribution", value.getDistribution(), null ); findAndReplaceSimpleElement( innerCount, root, "comments", value.getComments(), null ); } // -- void updateLicense(License, String, Counter, Element)
/** * Method updateLicense. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense(License value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null); findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null); findAndReplaceSimpleElement(innerCount, root, "distribution", value.getDistribution(), null); findAndReplaceSimpleElement(innerCount, root, "comments", value.getComments(), null); } // -- void updateLicense(License, String, Counter, Element)
if ( license.getComments() != null ) element.addElement( "comments" ).setText( license.getComments() );
/** * Method updateLicense. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateLicense( License value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null ); findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null ); findAndReplaceSimpleElement( innerCount, root, "distribution", value.getDistribution(), null ); findAndReplaceSimpleElement( innerCount, root, "comments", value.getComments(), null ); } // -- void updateLicense(License, String, Counter, Element)
if ( license.getComments() != null ) serializer.startTag( NAMESPACE, "comments" ).text( license.getComments() ).endTag( NAMESPACE, "comments" );
/** * Method writeLicense. * * @param license * @param serializer * @param tagName * @throws java.io.IOException */ private void writeLicense( License license, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( license.getName() != null ) { serializer.startTag( NAMESPACE, "name" ).text( license.getName() ).endTag( NAMESPACE, "name" ); } if ( license.getUrl() != null ) { serializer.startTag( NAMESPACE, "url" ).text( license.getUrl() ).endTag( NAMESPACE, "url" ); } if ( license.getDistribution() != null ) { serializer.startTag( NAMESPACE, "distribution" ).text( license.getDistribution() ).endTag( NAMESPACE, "distribution" ); } if ( license.getComments() != null ) { serializer.startTag( NAMESPACE, "comments" ).text( license.getComments() ).endTag( NAMESPACE, "comments" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeLicense( License, String, XmlSerializer )