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

项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
private void writeSite(Site site, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (site.getId() != null) {
        writeValue(serializer, "id", site.getId(), site);
    }
    if (site.getName() != null) {
        writeValue(serializer, "name", site.getName(), site);
    }
    if (site.getUrl() != null) {
        writeValue(serializer, "url", site.getUrl(), site);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(site, "", start, b.length());
}
项目:oceano    文件:MavenModelMerger.java   
@Override
protected void mergeSite_Url( Site target, Site source, boolean sourceDominant, Map<Object, Object> context )
{
    String src = source.getUrl();
    if ( src != null )
    {
        if ( sourceDominant )
        {
            target.setUrl( src );
            target.setLocation( "url", source.getLocation( "url" ) );
        }
        else if ( target.getUrl() == null )
        {
            target.setUrl( appendPath( src, context ) );
            target.setLocation( "url", source.getLocation( "url" ) );
        }
    }
}
项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
private void writeDistributionManagement(DistributionManagement distributionManagement, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();

    if (distributionManagement.getRepository() != null) {
        writeDeploymentRepository((DeploymentRepository) distributionManagement.getRepository(), "repository", serializer);
    }
    if (distributionManagement.getSnapshotRepository() != null) {
        writeDeploymentRepository((DeploymentRepository) distributionManagement.getSnapshotRepository(), "snapshotRepository", serializer);
    }
    if (distributionManagement.getSite() != null) {
        writeSite((Site) distributionManagement.getSite(), "site", serializer);
    }
    if (distributionManagement.getDownloadUrl() != null) {
        writeValue(serializer, "downloadUrl", distributionManagement.getDownloadUrl(), distributionManagement);
    }
    if (distributionManagement.getRelocation() != null) {
        writeRelocation((Relocation) distributionManagement.getRelocation(), "relocation", serializer);
    }
    if (distributionManagement.getStatus() != null) {
        writeValue(serializer, "status", distributionManagement.getStatus(), distributionManagement);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(distributionManagement, "", start, b.length());
}
项目:apache-maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateSite
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateSite( Site 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, "id", value.getId(), null );
        findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
        findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
    }
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitDistributionManagement( ModelVisitor visitor, DistributionManagement distributionManagement )
{
    DeploymentRepository repository = distributionManagement.getRepository();
    if ( repository != null )
    {
        visitor.visitDistributionManagementRepository( repository );
        visitDistributionManagementRepository( visitor, repository );
        repository = visitor.replaceDistributionManagementRepository( repository );
        distributionManagement.setRepository( repository );
    }

    DeploymentRepository snapshotRepository = distributionManagement.getSnapshotRepository();
    if ( snapshotRepository != null )
    {
        visitor.visitDistributionManagementSnapshotRepository( snapshotRepository );
        visitDistributionManagementSnapshotRepository( visitor, snapshotRepository );
        snapshotRepository = visitor.replaceDistributionManagementSnapshotRepository( snapshotRepository );
        distributionManagement.setSnapshotRepository( snapshotRepository );
    }

    Site site = distributionManagement.getSite();
    if ( site != null )
    {
        visitor.visitDistributionManagementSite( site );
        site = visitor.replaceDistributionManagementSite( site );
        distributionManagement.setSite( site );
    }

    Relocation relocation = distributionManagement.getRelocation();
    if ( relocation != null )
    {
        visitor.visitDistributionManagementRelocation( relocation );
        relocation = visitor.replaceDistributionManagementRelocation( relocation );
        distributionManagement.setRelocation( relocation );
    }
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitProfileDistributionManagement( ModelVisitor visitor,
                                                 DistributionManagement distributionManagement )
{
    DeploymentRepository repository = distributionManagement.getRepository();
    if ( repository != null )
    {
        visitor.visitProfileDistributionManagementRepository( repository );
        visitProfileDistributionManagementRepository( visitor, repository );
        repository = visitor.replaceProfileDistributionManagementRepository( repository );
        distributionManagement.setRepository( repository );
    }

    DeploymentRepository snapshotRepository = distributionManagement.getSnapshotRepository();
    if ( snapshotRepository != null )
    {
        visitor.visitProfileDistributionManagementSnapshotRepository( snapshotRepository );
        visitProfileDistributionManagementSnapshotRepository( visitor, snapshotRepository );
        snapshotRepository = visitor.replaceProfileDistributionManagementSnapshotRepository( snapshotRepository );
        distributionManagement.setSnapshotRepository( snapshotRepository );
    }

    Site site = distributionManagement.getSite();
    if ( site != null )
    {
        visitor.visitProfileDistributionManagementSite( site );
        site = visitor.replaceProfileDistributionManagementSite( site );
        distributionManagement.setSite( site );
    }

    Relocation relocation = distributionManagement.getRelocation();
    if ( relocation != null )
    {
        visitor.visitProfileDistributionManagementRelocation( relocation );
        relocation = visitor.replaceProfileDistributionManagementRelocation( relocation );
        distributionManagement.setRelocation( relocation );
    }
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateSite
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateSite( Site 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, "id", value.getId(), null );
        findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
        findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeSite_Id( Site target, Site source, boolean sourceDominant, Map<Object, Object> context )
{
    String src = source.getId();
    if ( src != null )
    {
        if ( sourceDominant || target.getId() == null )
        {
            target.setId( src );
            target.setLocation( "id", source.getLocation( "id" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeSite_Name( Site target, Site 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 mergeSite_Url( Site target, Site source, boolean sourceDominant, Map<Object, Object> context )
{
    String src = source.getUrl();
    if ( src != null )
    {
        if ( sourceDominant || target.getUrl() == null )
        {
            target.setUrl( src );
            target.setLocation( "url", source.getLocation( "url" ) );
        }
    }
}
项目:oceano    文件:DefaultModelUrlNormalizer.java   
public void normalize( Model model, ModelBuildingRequest request )
{
    if ( model == null )
    {
        return;
    }

    model.setUrl( normalize( model.getUrl() ) );

    Scm scm = model.getScm();
    if ( scm != null )
    {
        scm.setUrl( normalize( scm.getUrl() ) );
        scm.setConnection( normalize( scm.getConnection() ) );
        scm.setDeveloperConnection( normalize( scm.getDeveloperConnection() ) );
    }

    DistributionManagement dist = model.getDistributionManagement();
    if ( dist != null )
    {
        Site site = dist.getSite();
        if ( site != null )
        {
            site.setUrl( normalize( site.getUrl() ) );
        }
    }
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public Site replaceDistributionManagementSite( Site site )
{
    return site;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public Site replaceProfileDistributionManagementSite( Site site )
{
    return site;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitDistributionManagementSite( Site site )
{
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitProfileDistributionManagementSite( Site site )
{
}
项目:oceano    文件:ModelMerger.java   
protected void mergeSite( Site target, Site source, boolean sourceDominant, Map<Object, Object> context )
{
    mergeSite_Id( target, source, sourceDominant, context );
    mergeSite_Name( target, source, sourceDominant, context );
    mergeSite_Url( target, source, sourceDominant, context );
}
项目:xmvn    文件:ModelVisitor.java   
Site replaceDistributionManagementSite( Site site );
项目:xmvn    文件:ModelVisitor.java   
Site replaceProfileDistributionManagementSite( Site site );
项目:xmvn    文件:ModelVisitor.java   
void visitDistributionManagementSite( Site site );
项目:xmvn    文件:ModelVisitor.java   
void visitProfileDistributionManagementSite( Site site );