本文整理汇总了Java中org.apache.maven.model.MailingList类的典型用法代码示例。如果您正苦于以下问题:Java MailingList类的具体用法?Java MailingList怎么用?Java MailingList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MailingList类属于org.apache.maven.model包,在下文中一共展示了MailingList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertMailingLists
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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;
}
示例2: visitMailingList
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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 );
}
}
}
示例3: writeMailingList
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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());
}
示例4: updateMailingList
import org.apache.maven.model.MailingList; //导入依赖的package包/类
/**
* 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" );
}
示例5: testProjectInheritance
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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() );
}
示例6: mergeMailingList
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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 );
}
示例7: mergeMailingList_Name
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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" ) );
}
}
}
示例8: mergeMailingList_Subscribe
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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" ) );
}
}
}
示例9: mergeMailingList_Unsubscribe
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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" ) );
}
}
}
示例10: mergeMailingList_Post
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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" ) );
}
}
}
示例11: mergeMailingList_Archive
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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" ) );
}
}
}
示例12: mergeMailingList_OtherArchives
import org.apache.maven.model.MailingList; //导入依赖的package包/类
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 );
}
}
示例13: mergeModel_MailingLists
import org.apache.maven.model.MailingList; //导入依赖的package包/类
@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() ) );
}
}
示例14: replaceMailingList
import org.apache.maven.model.MailingList; //导入依赖的package包/类
@Override
public MailingList replaceMailingList( MailingList mailingList )
{
return mailingList;
}
示例15: visitMailingList
import org.apache.maven.model.MailingList; //导入依赖的package包/类
@Override
public void visitMailingList( MailingList mailingList )
{
}