org.apache.maven.model.Organization类的使用及代码示例

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

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

Organization介绍

[英]Specifies the organization that produces this project.
[中]指定生成此项目的组织。

代码示例

代码示例来源: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: 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

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: apache/maven

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

代码示例来源:origin: speedment/speedment

private String getCompanyNameFromMavenProject() {
  if (mavenProject.getOrganization() != null) {
    return mavenProject.getOrganization().getName();
  } else {
    return null;
  }
}

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

if ( organization.getName() != null )
  serializer.writeCharacters( organization.getName() );
  serializer.writeEndElement();
if ( organization.getUrl() != null )
  serializer.writeCharacters( organization.getUrl() );
  serializer.writeEndElement();
if ( organization.getLogo() != null )
  serializer.writeCharacters( organization.getLogo() );
  serializer.writeEndElement();

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

Organization organization = new Organization();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
    organization.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
    organization.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );

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

throws IOException, XMLStreamException
Organization organization = new Organization();
organization.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
    organization.setName( getTrimmedValue( xmlStreamReader.getElementText()) );
    organization.setUrl( getTrimmedValue( xmlStreamReader.getElementText()) );
    organization.setLogo( getTrimmedValue( xmlStreamReader.getElementText()) );

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

Organization organization = new Organization();
InputLocation _location;
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
organization.setLocation( "", _location );
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
    organization.setLocation( "name", _location );
    organization.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
    organization.setLocation( "url", _location );
    organization.setUrl( interpolatedTrimmed( parser.nextText(), "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: stackoverflow.com

public Organization getOrCreateOrganization(String name) {
  Criteria crit = session.createCriteria(Organization.class);
  crit.add(Restrictions.eq("name", name));
  Organization result = (Organization)crit.uniqueResult();
  if (result == null) {
    result = new Organization();
    result.setName(name);
    session.save(result);
  }
  return result;
}

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

@Override
protected void mergeModel_Organization( Model target, Model source, boolean sourceDominant,
                    Map<Object, Object> context )
{
  Organization src = source.getOrganization();
  if ( src != null )
  {
    Organization tgt = target.getOrganization();
    if ( tgt == null )
    {
      tgt = new Organization();
      tgt.setLocation( "", src.getLocation( "" ) );
      target.setOrganization( tgt );
      mergeOrganization( tgt, src, sourceDominant, context );
    }
  }
}

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

protected void mergeModel_Organization( Model target, Model source, boolean sourceDominant,
                    Map<Object, Object> context )
{
  Organization src = source.getOrganization();
  if ( src != null )
  {
    Organization tgt = target.getOrganization();
    if ( tgt == null )
    {
      tgt = new Organization();
      target.setOrganization( tgt );
    }
    mergeOrganization( tgt, src, sourceDominant, context );
  }
}

代码示例来源:origin: stackoverflow.com

@Path("{id}")
@PUT
@Consumes("application/json")
@Produces("application/json")
public Organization edit(OrganizationDTO dto,
           @PathParam("id") Long id) {
 // lookup entity from database
 Organization org = entityManager.find( Organization.class, entity.getId() );
 // map changable values to the entity
 org.setName( dto.getName() );
 org.setDescription( dto.getDescription() );
 org.setUser( entityManager.find( User.class, userId ) );
 dto.setUser( org.getUser() );
 // merge changes
 entityManager.merge( org );
 // return dto
 return dto;
}

代码示例来源:origin: stackoverflow.com

@Test
 public void testAddOrg() {
   final Organization expectedOrg = new Organization();
   expectedOrgAttr.setId("7c82facc");
   expectedOrgAttr.setKeys("one");
   new Expectations() {{
     mockJdbcTemplate.queryForObject(DAOImpl.GET_KEY_FOR_ORG_IDS, (DAORowMapper) any, expectedOrgAttr.getId(), expectedOrgAttr.getKeys());
     result = expectedOrgAttr;
   }};
   Organization actualKey =daoImpl.addOrg(expectedOrgAttr.getId(), expectedOrgAttr.getKeys());
   assertEquals(expectedOrgAttr.getId(), actualKey.getId());
 }

代码示例来源:origin: stackoverflow.com

public Organization getContactOrg(String id) {
  Organization org = new Organization();
  String where = ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " = ?"; 
  String[] whereParameters = new String[]{id, 
      ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE}; 

  Cursor orgCur = this.cr.query(ContactsContract.Data.CONTENT_URI, null, where, whereParameters, null);

  if (orgCur.moveToFirst()) { 
    String orgName = orgCur.getString(orgCur.getColumnIndex(ContactsContract.CommonDataKinds.Organization.DATA));
    String title = orgCur.getString(orgCur.getColumnIndex(ContactsContract.CommonDataKinds.Organization.TITLE));
    if (orgName.length() > 0) {
      org.setOrganization(orgName);
      org.setTitle(title);
    }
  } 
  orgCur.close();
  return(org);
}

代码示例来源:origin: rapidoid/rapidoid

private void addJarManifest(String uberJar, MavenProject project, String mainClass) throws IOException {
  Path path = Paths.get(uberJar);
  URI uri = URI.create("jar:" + path.toUri());
  String user = System.getProperty("user.name");
  String manifestContent = IO.load("manifest-template.mf")
    .replace("$user", user)
    .replace("$java", Msc.javaVersion())
    .replace("$name", project.getName())
    .replace("$version", project.getVersion())
    .replace("$groupId", project.getGroupId())
    .replace("$organization", project.getOrganization() != null ? U.or(project.getOrganization().getName(), "?") : "?")
    .replace("$url", U.or(project.getUrl(), "?"))
    .replace("$main", U.safe(mainClass));
  try (FileSystem fs = FileSystems.newFileSystem(uri, U.map())) {
    Path manifest = fs.getPath("META-INF/MANIFEST.MF");
    try (Writer writer = Files.newBufferedWriter(manifest, StandardCharsets.UTF_8, StandardOpenOption.CREATE)) {
      writer.write(manifestContent);
    }
  }
}

代码示例来源: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: io.tesla.maven/maven-model

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

代码示例来源: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" ) );
    }
  }
}

相关文章