Java 类org.apache.maven.model.MailingList 实例源码

项目:apache-archiva    文件:Maven2RepositoryStorage.java   
private List<org.apache.archiva.metadata.model.MailingList> convertMailingLists( List<MailingList> mailingLists )
{
    List<org.apache.archiva.metadata.model.MailingList> l = new ArrayList<>();
    for ( MailingList mailingList : mailingLists )
    {
        org.apache.archiva.metadata.model.MailingList newMailingList =
            new org.apache.archiva.metadata.model.MailingList();
        newMailingList.setName( mailingList.getName() );
        newMailingList.setMainArchiveUrl( mailingList.getArchive() );
        newMailingList.setPostAddress( mailingList.getPost() );
        newMailingList.setSubscribeAddress( mailingList.getSubscribe() );
        newMailingList.setUnsubscribeAddress( mailingList.getUnsubscribe() );
        newMailingList.setOtherArchives( mailingList.getOtherArchives() );
        l.add( newMailingList );
    }
    return l;
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitMailingList( ModelVisitor visitor, MailingList mailingList )
{
    List<String> otherArchives = mailingList.getOtherArchives();
    if ( otherArchives != null )
    {
        ListIterator<String> otherArchiveIterator = otherArchives.listIterator();
        while ( otherArchiveIterator.hasNext() )
        {
            String otherArchive = otherArchiveIterator.next();
            visitor.visitMailingListOtherArchive( otherArchive );
            otherArchive = visitor.replaceMailingListOtherArchive( otherArchive );
            if ( otherArchive == null )
                otherArchiveIterator.remove();
            else
                otherArchiveIterator.set( otherArchive );
        }
    }
}
项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
private void writeMailingList(MailingList mailingList, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();

    if (mailingList.getName() != null) {
        writeValue(serializer, "name", mailingList.getName(), mailingList);
    }
    if (mailingList.getSubscribe() != null) {
        writeValue(serializer, "subscribe", mailingList.getSubscribe(), mailingList);
    }
    if (mailingList.getUnsubscribe() != null) {
        writeValue(serializer, "unsubscribe", mailingList.getUnsubscribe(), mailingList);
    }
    if (mailingList.getPost() != null) {
        writeValue(serializer, "post", mailingList.getPost(), mailingList);
    }
    if (mailingList.getArchive() != null) {
        writeValue(serializer, "archive", mailingList.getArchive(), mailingList);
    }
    if ((mailingList.getOtherArchives() != null) && (mailingList.getOtherArchives().size() > 0)) {
        serializer.startTag(NAMESPACE, "otherArchives");
        flush(serializer);
        InputLocation otherLoc = mailingList.getLocation("otherArchives");
        int index = 0;
        for (Iterator iter = mailingList.getOtherArchives().iterator(); iter.hasNext();) {
            String otherArchive = (String) iter.next();
            writeValue(serializer, "otherArchive", otherArchive, otherLoc, index);
            index = index + 1;
        }
        serializer.endTag(NAMESPACE, "otherArchives");
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(mailingList, "", start, b.length());

}
项目:apache-maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateMailingList
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateMailingList( MailingList 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, "subscribe", value.getSubscribe(), null );
    findAndReplaceSimpleElement( innerCount, root, "unsubscribe", value.getUnsubscribe(), null );
    findAndReplaceSimpleElement( innerCount, root, "post", value.getPost(), null );
    findAndReplaceSimpleElement( innerCount, root, "archive", value.getArchive(), null );
    findAndReplaceSimpleLists( innerCount, root, value.getOtherArchives(), "otherArchives", "otherArchive" );
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateMailingList
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateMailingList( MailingList 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, "subscribe", value.getSubscribe(), null );
    findAndReplaceSimpleElement( innerCount, root, "unsubscribe", value.getUnsubscribe(), null );
    findAndReplaceSimpleElement( innerCount, root, "post", value.getPost(), null );
    findAndReplaceSimpleElement( innerCount, root, "archive", value.getArchive(), null );
    findAndReplaceSimpleLists( innerCount, root, value.getOtherArchives(), "otherArchives", "otherArchive" );
}
项目:oceano    文件:ProjectInheritanceTest.java   
public void testProjectInheritance()
    throws Exception
{
    MavenProject p4 = getProject( projectFile( "p4" ) );

    assertEquals( "p4", p4.getName() );

    // ----------------------------------------------------------------------
    // Value inherited from p3
    // ----------------------------------------------------------------------

    assertEquals( "2000", p4.getInceptionYear() );

    // ----------------------------------------------------------------------
    // Value taken from p2
    // ----------------------------------------------------------------------

    assertEquals( "mailing-list", ( (MailingList) p4.getMailingLists().get( 0 ) ).getName() );

    // ----------------------------------------------------------------------
    // Value taken from p1
    // ----------------------------------------------------------------------

    assertEquals( "scm-url/p2/p3/p4", p4.getScm().getUrl() );

    // ----------------------------------------------------------------------
    // Value taken from p4
    // ----------------------------------------------------------------------

    assertEquals( "Codehaus", p4.getOrganization().getName() );

    // ----------------------------------------------------------------------
    // Value taken from super model
    // ----------------------------------------------------------------------

    assertEquals( "4.0.0", p4.getModelVersion() );

    assertEquals( "4.0.0", p4.getModelVersion() );
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList( MailingList target, MailingList source, boolean sourceDominant,
                                 Map<Object, Object> context )
{
    mergeMailingList_Name( target, source, sourceDominant, context );
    mergeMailingList_Subscribe( target, source, sourceDominant, context );
    mergeMailingList_Unsubscribe( target, source, sourceDominant, context );
    mergeMailingList_Post( target, source, sourceDominant, context );
    mergeMailingList_OtherArchives( target, source, sourceDominant, context );
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList_Name( MailingList target, MailingList source, boolean sourceDominant,
                                      Map<Object, Object> context )
{
    String src = source.getName();
    if ( src != null )
    {
        if ( sourceDominant || target.getName() == null )
        {
            target.setName( src );
            target.setLocation( "name", source.getLocation( "name" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList_Subscribe( MailingList target, MailingList source, boolean sourceDominant,
                                           Map<Object, Object> context )
{
    String src = source.getSubscribe();
    if ( src != null )
    {
        if ( sourceDominant || target.getSubscribe() == null )
        {
            target.setSubscribe( src );
            target.setLocation( "subscribe", source.getLocation( "subscribe" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList_Unsubscribe( MailingList target, MailingList source, boolean sourceDominant,
                                             Map<Object, Object> context )
{
    String src = source.getUnsubscribe();
    if ( src != null )
    {
        if ( sourceDominant || target.getUnsubscribe() == null )
        {
            target.setUnsubscribe( src );
            target.setLocation( "unsubscribe", source.getLocation( "unsubscribe" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList_Post( MailingList target, MailingList source, boolean sourceDominant,
                                      Map<Object, Object> context )
{
    String src = source.getPost();
    if ( src != null )
    {
        if ( sourceDominant || target.getPost() == null )
        {
            target.setPost( src );
            target.setLocation( "post", source.getLocation( "post" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList_Archive( MailingList target, MailingList source, boolean sourceDominant,
                                         Map<Object, Object> context )
{
    String src = source.getArchive();
    if ( src != null )
    {
        if ( sourceDominant || target.getArchive() == null )
        {
            target.setArchive( src );
            target.setLocation( "archive", source.getLocation( "archive" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeMailingList_OtherArchives( MailingList target, MailingList source, boolean sourceDominant,
                                               Map<Object, Object> context )
{
    List<String> src = source.getOtherArchives();
    if ( !src.isEmpty() )
    {
        List<String> tgt = target.getOtherArchives();
        List<String> merged = new ArrayList<String>( tgt.size() + src.size() );
        merged.addAll( tgt );
        merged.addAll( src );
        target.setOtherArchives( merged );
    }
}
项目:oceano    文件:MavenModelMerger.java   
@Override
protected void mergeModel_MailingLists( Model target, Model source, boolean sourceDominant,
                                        Map<Object, Object> context )
{
    if ( target.getMailingLists().isEmpty() )
    {
        target.setMailingLists( new ArrayList<MailingList>( source.getMailingLists() ) );
    }
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public MailingList replaceMailingList( MailingList mailingList )
{
    return mailingList;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitMailingList( MailingList mailingList )
{
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public List<MailingList> get( Model model )
{
    return model.getMailingLists();
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public void set( Model model, List<MailingList> value )
{
    model.setMailingLists( value );
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method iterateMailingList
 *
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateMailingList( Counter counter, Element parent, java.util.Collection list,
                                   java.lang.String parentTag, java.lang.String childTag )
{
    boolean shouldExist = list != null && list.size() > 0;
    Element element = updateElement( counter, parent, parentTag, shouldExist );
    if ( shouldExist )
    {
        Iterator it = list.iterator();
        Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
        if ( !elIt.hasNext() )
        {
            elIt = null;
        }
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        while ( it.hasNext() )
        {
            MailingList value = (MailingList) it.next();
            Element el;
            if ( elIt != null && elIt.hasNext() )
            {
                el = (Element) elIt.next();
                if ( !elIt.hasNext() )
                {
                    elIt = null;
                }
            }
            else
            {
                el = factory.element( childTag, element.getNamespace() );
                insertAtPreferredLocation( element, el, innerCount );
            }
            updateMailingList( value, childTag, innerCount, el );
            innerCount.increaseCount();
        }
        if ( elIt != null )
        {
            while ( elIt.hasNext() )
            {
                elIt.next();
                elIt.remove();
            }
        }
    }
}
项目:oceano    文件:MavenProject.java   
public void setMailingLists( List<MailingList> mailingLists )
{
    getModel().setMailingLists( mailingLists );
}
项目:oceano    文件:MavenProject.java   
public List<MailingList> getMailingLists()
{
    return getModel().getMailingLists();
}
项目:oceano    文件:MavenProject.java   
public void addMailingList( MailingList mailingList )
{
    getModel().addMailingList( mailingList );
}
项目:oceano    文件:ModelMerger.java   
protected Object getMailingListKey( MailingList object )
{
    return object;
}
项目:jwrapper-maven-plugin    文件:MavenProjectDelegate.java   
@Override
public void addMailingList(final MailingList mailingList) {
    getDelegate().addMailingList(mailingList);
}
项目:Pogamut3    文件:DependencyProjectStub.java   
public void addMailingList( MailingList mailingList )
{

}
项目:xmvn    文件:ModelVisitor.java   
MailingList replaceMailingList( MailingList mailingList );
项目:xmvn    文件:ModelVisitor.java   
void visitMailingList( MailingList mailingList );