org.apache.maven.model.Organization.getUrl()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(10.9k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.apache.maven.model.Organization.getUrl()方法的一些代码示例,展示了Organization.getUrl()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Organization.getUrl()方法的具体详情如下:
包路径:org.apache.maven.model.Organization
类名称:Organization
方法名:getUrl

Organization.getUrl介绍

[英]Get the URL to the organization's home page.
[中]获取组织主页的URL。

代码示例

代码示例来源:origin: apache/maven

protected void mergeOrganization_Url( Organization target, Organization 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" ) );
    }
  }
}

代码示例来源:origin: org.apache.maven/maven-project

public static Organization cloneOrganization( Organization src )
{
  if ( src == null )
  {
    return null;
  }
  
  Organization result = new Organization();
  
  result.setName( src.getName() );
  result.setUrl( src.getUrl() );
  
  return result;
}

代码示例来源:origin: apache/maven

/**
 * Method writeOrganization.
 * 
 * @param organization
 * @param serializer
 * @param tagName
 * @throws java.io.IOException
 */
private void writeOrganization( Organization organization, String tagName, XmlSerializer serializer )
  throws java.io.IOException
{
  serializer.startTag( NAMESPACE, tagName );
  if ( organization.getName() != null )
  {
    serializer.startTag( NAMESPACE, "name" ).text( organization.getName() ).endTag( NAMESPACE, "name" );
  }
  if ( organization.getUrl() != null )
  {
    serializer.startTag( NAMESPACE, "url" ).text( organization.getUrl() ).endTag( NAMESPACE, "url" );
  }
  serializer.endTag( NAMESPACE, tagName );
} //-- void writeOrganization( Organization, String, XmlSerializer )

代码示例来源:origin: takari/polyglot-maven

/**
 * Method writeOrganization.
 * 
 * @param organization
 * @param serializer
 * @param tagName
 * @throws java.io.IOException
 */
private void writeOrganization( Organization organization, String tagName, XmlSerializer serializer )
  throws java.io.IOException
{
  serializer.startTag( NAMESPACE, tagName );
  if ( organization.getName() != null )
  {
    serializer.attribute( NAMESPACE, "name", organization.getName() );
  }
  if ( organization.getUrl() != null )
  {
    serializer.attribute( NAMESPACE, "url", organization.getUrl() );
  }
  serializer.endTag( NAMESPACE, tagName );
} //-- void writeOrganization( Organization, String, XmlSerializer )

代码示例来源:origin: io.tesla.maven/maven-model

protected void mergeOrganization_Url( Organization target, Organization 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" ) );
    }
  }
}

代码示例来源:origin: ctron/rpm-builder

private String makePackager ()
{
  if ( this.project.getOrganization () == null )
  {
    return null;
  }
  final String org = this.project.getOrganization ().getName ();
  final String url = this.project.getOrganization ().getUrl ();
  if ( org == null || url == null || org.isEmpty () || url.isEmpty () )
  {
    return null;
  }
  return String.format ( "%s <%s>", org, url );
}

代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

@Override
public URL getOrganizationUrl() {
  if (model.getOrganization() == null) {
    return null;
  }
  String url = model.getOrganization().getUrl();
  if (Validate.isNullOrEmpty(url)) {
    return null;
  }
  else {
    try {
      return new URL(url);
    } catch (MalformedURLException e) {
      throw new IllegalStateException(url
          + " does not represent a valid URL, unable to get Organization URL from the POM file");
    }
  }
}

代码示例来源:origin: shrinkwrap/resolver

@Override
public URL getOrganizationUrl() {
  if (model.getOrganization() == null) {
    return null;
  }
  String url = model.getOrganization().getUrl();
  if (Validate.isNullOrEmpty(url)) {
    return null;
  }
  else {
    try {
      return new URL(url);
    } catch (MalformedURLException e) {
      throw new IllegalStateException(url
          + " does not represent a valid URL, unable to get Organization URL from the POM file");
    }
  }
}

代码示例来源:origin: apache/archiva

private org.apache.archiva.metadata.model.Organization convertOrganization( Organization organization )
{
  org.apache.archiva.metadata.model.Organization org = null;
  if ( organization != null )
  {
    org = new org.apache.archiva.metadata.model.Organization();
    org.setName( organization.getName() );
    org.setUrl( organization.getUrl() );
  }
  return org;
}

代码示例来源:origin: org.apache.archiva/maven2-repository

private org.apache.archiva.metadata.model.Organization convertOrganization( Organization organization )
{
  org.apache.archiva.metadata.model.Organization org = null;
  if ( organization != null )
  {
    org = new org.apache.archiva.metadata.model.Organization();
    org.setName( organization.getName() );
    org.setUrl( organization.getUrl() );
  }
  return org;
}

代码示例来源:origin: io.tesla.maven/maven-model

/**
 * Method writeOrganization.
 * 
 * @param organization
 * @param serializer
 * @param tagName
 * @throws java.io.IOException
 */
private void writeOrganization( Organization organization, String tagName, XmlSerializer serializer )
  throws java.io.IOException
{
  serializer.startTag( NAMESPACE, tagName );
  if ( organization.getName() != null )
  {
    serializer.startTag( NAMESPACE, "name" ).text( organization.getName() ).endTag( NAMESPACE, "name" );
  }
  if ( organization.getUrl() != null )
  {
    serializer.startTag( NAMESPACE, "url" ).text( organization.getUrl() ).endTag( NAMESPACE, "url" );
  }
  serializer.endTag( NAMESPACE, tagName );
} //-- void writeOrganization( Organization, String, XmlSerializer )

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder

/**
 * Method updateOrganization.
 * 
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateOrganization(Organization 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,  "url", value.getUrl(), null);
  }
} //-- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder

/**
 * Method updateOrganization
 * 
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateOrganization(Organization 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,  "url", value.getUrl(), null);
  }
} //-- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: org.jboss.forge.addon/maven-impl

/**
* Method updateOrganization.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateOrganization(Organization 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, "url", value.getUrl(), null);
 }
} // -- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: org.apache.felix/maven-bundle-plugin

/**
 * Method updateOrganization
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateOrganization( Organization 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, "url", value.getUrl(), null );
  }
} // -- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: org.apache.maven.plugins/maven-shade-plugin

/**
 * Method updateOrganization
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateOrganization( Organization 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, "url", value.getUrl(), null );
  }
} // -- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: apache/maven-archetype

/**
 * Method updateOrganization.
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateOrganization( Organization 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, "url", value.getUrl(), null );
  }
} // -- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: maven/maven-model

/**
 * Method writeOrganization
 * 
 * @param organization
 * @param parentElement
 * @param tagName
 */
private void writeOrganization(Organization organization, String tagName, Element parentElement)
  throws java.io.IOException
{
  if ( organization != null )
  {
    Element element = parentElement.addElement( tagName );
    if ( organization.getName() != null )
    {
      element.addElement( "name" ).setText( organization.getName() );
    }
    if ( organization.getUrl() != null )
    {
      element.addElement( "url" ).setText( organization.getUrl() );
    }
    if ( organization.getLogo() != null )
    {
      element.addElement( "logo" ).setText( organization.getLogo() );
    }
  }
} //-- void writeOrganization(Organization, String, Element)

代码示例来源:origin: org.sonatype.maven.archetype/archetype-common

/**
 * Method updateOrganization.
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateOrganization(
  Organization 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, "url", value.getUrl(), null );
  }
} // -- void updateOrganization(Organization, String, Counter, Element)

代码示例来源:origin: maven/maven-model

/**
 * Method writeOrganization
 * 
 * @param organization
 * @param serializer
 * @param tagName
 */
private void writeOrganization(Organization organization, String tagName, XmlSerializer serializer)
  throws java.io.IOException
{
  if ( organization != null )
  {
    serializer.startTag( NAMESPACE, tagName );
    if ( organization.getName() != null )
    {
      serializer.startTag( NAMESPACE, "name" ).text( organization.getName() ).endTag( NAMESPACE, "name" );
    }
    if ( organization.getUrl() != null )
    {
      serializer.startTag( NAMESPACE, "url" ).text( organization.getUrl() ).endTag( NAMESPACE, "url" );
    }
    if ( organization.getLogo() != null )
    {
      serializer.startTag( NAMESPACE, "logo" ).text( organization.getLogo() ).endTag( NAMESPACE, "logo" );
    }
    serializer.endTag( NAMESPACE, tagName );
  }
} //-- void writeOrganization(Organization, String, XmlSerializer)

相关文章