aQute.bnd.osgi.Builder.getBsn()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(105)

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

Builder.getBsn介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Return a build that maps to the sub file.
 *
 * @param string
 * @throws Exception
 */
public ProjectBuilder getSubBuilder(String string) throws Exception {
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder b : builders) {
    if (b.getBsn().equals(string) || b.getBsn().endsWith("." + string))
      return (ProjectBuilder) b;
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Return a build that maps to the sub file.
 *
 * @param string
 * @throws Exception
 */
public ProjectBuilder getSubBuilder(String string) throws Exception {
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder b : builders) {
    if (b.getBsn().equals(string) || b.getBsn().endsWith("." + string))
      return (ProjectBuilder) b;
  }
  return null;
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Returns containers for the deliverables of this project. The deliverables
 * is the project builder for this project if no -sub is specified.
 * Otherwise it contains all the sub bnd files.
 * 
 * @return A collection of containers
 * @throws Exception
 */
public Collection<Container> getDeliverables() throws Exception {
  List<Container> result = new ArrayList<Container>();
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder builder : builders) {
    Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT,
        getOutputFile(builder.getBsn()), null, null, null);
    result.add(c);
  }
  return result;
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Returns containers for the deliverables of this project. The deliverables
 * is the project builder for this project if no -sub is specified.
 * Otherwise it contains all the sub bnd files.
 *
 * @return A collection of containers
 * @throws Exception
 */
public Collection<Container> getDeliverables() throws Exception {
  List<Container> result = new ArrayList<Container>();
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder builder : builders) {
    Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT,
        getOutputFile(builder.getBsn()), null, null, null);
    result.add(c);
  }
  return result;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Returns containers for the deliverables of this project. The deliverables
 * is the project builder for this project if no -sub is specified.
 * Otherwise it contains all the sub bnd files.
 *
 * @return A collection of containers
 * @throws Exception
 */
public Collection<Container> getDeliverables() throws Exception {
  List<Container> result = new ArrayList<Container>();
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder builder : builders) {
    Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT,
        getOutputFile(builder.getBsn()), null, null, null);
    result.add(c);
  }
  return result;
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Answer the container associated with a given bsn.
 * 
 * @param bndFile
 *            A file pointing to a bnd file.
 * @return null or the builder for a sub file.
 * @throws Exception
 */
public Container getDeliverable(String bsn, @SuppressWarnings("unused")
Map<String,String> attrs) throws Exception {
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder sub : builders) {
    if (sub.getBsn().equals(bsn))
      return new Container(this, getOutputFile(bsn));
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Returns containers for the deliverables of this project. The deliverables
 * is the project builder for this project if no -sub is specified.
 * Otherwise it contains all the sub bnd files.
 *
 * @return A collection of containers
 * @throws Exception
 */
public Collection<Container> getDeliverables() throws Exception {
  List<Container> result = new ArrayList<>();
  try (ProjectBuilder pb = getBuilder(null)) {
    for (Builder builder : pb.getSubBuilders()) {
      Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT,
        getOutputFile(builder.getBsn(), builder.getVersion()), null, null, null);
      result.add(c);
    }
    return result;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Returns containers for the deliverables of this project. The deliverables
 * is the project builder for this project if no -sub is specified.
 * Otherwise it contains all the sub bnd files.
 *
 * @return A collection of containers
 * @throws Exception
 */
public Collection<Container> getDeliverables() throws Exception {
  List<Container> result = new ArrayList<>();
  try (ProjectBuilder pb = getBuilder(null)) {
    for (Builder builder : pb.getSubBuilders()) {
      Container c = new Container(this, builder.getBsn(), builder.getVersion(), Container.TYPE.PROJECT,
        getOutputFile(builder.getBsn(), builder.getVersion()), null, null, null);
      result.add(c);
    }
    return result;
  }
}

代码示例来源:origin: biz.aQute.bnd/bndlib

public Map<String, Version> getVersions() throws Exception {
  synchronized (versionMap) {
    if (versionMap.isEmpty()) {
      for (Builder builder : getSubBuilders()) {
        String v = builder.getVersion();
        if (v == null)
          v = "0";
        else {
          v = Analyzer.cleanupVersion(v);
          if (!Verifier.isVersion(v))
            continue; // skip
        }
        Version version = new Version(v);
        versionMap.put(builder.getBsn(), version);
      }
    }
    return new LinkedHashMap<String, Version>(versionMap);
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 */
void sign(@SuppressWarnings("unused") Jar jar) throws Exception {
  String signing = getProperty(SIGN);
  if (signing == null)
    return;
  logger.debug("Signing {}, with {}", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String, Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public Map<String, Version> getVersions() throws Exception {
  if (versionMap.isEmpty()) {
    try (ProjectBuilder pb = getBuilder(null)) {
      for (Builder builder : pb.getSubBuilders()) {
        String v = builder.getVersion();
        if (v == null)
          v = "0";
        else {
          v = Analyzer.cleanupVersion(v);
          if (!Verifier.isVersion(v))
            continue; // skip
        }
        Version version = new Version(v);
        versionMap.put(builder.getBsn(), version);
      }
    }
  }
  return new LinkedHashMap<>(versionMap);
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Answer the container associated with a given bsn.
 *
 * @param bndFile
 *            A file pointing to a bnd file.
 * @return null or the builder for a sub file.
 * @throws Exception
 */
public Container getDeliverable(String bsn, @SuppressWarnings("unused")
Map<String,String> attrs) throws Exception {
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder sub : builders) {
    if (sub.getBsn().equals(bsn))
      return new Container(this, getOutputFile(bsn, sub.getVersion()));
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 */
void sign(@SuppressWarnings("unused") Jar jar) throws Exception {
  String signing = getProperty(SIGN);
  if (signing == null)
    return;
  logger.debug("Signing {}, with {}", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String, Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

代码示例来源:origin: biz.aQute/bndlib

public SortedSet<Version> versions(String bsn) throws Exception {
  List<Version> versions = new ArrayList<Version>();
  Collection<Project> projects = workspace.getAllProjects();
  for (Project project : projects) {
    for (Builder builder : project.getSubBuilders()) {
      if (bsn.equals(builder.getBsn())) {
        String v  = builder.getVersion();
        if (v == null)
          v = "0";
        else if (!Verifier.isVersion(v))
          continue; // skip
        
        versions.add(new Version(v));
      }
    }
  }
  if ( versions.isEmpty())
    return SortedList.empty();
  
  return new SortedList<Version>(versions);
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Answer the container associated with a given bsn.
 *
 * @param bndFile
 *            A file pointing to a bnd file.
 * @return null or the builder for a sub file.
 * @throws Exception
 */
public Container getDeliverable(String bsn, @SuppressWarnings("unused")
Map<String,String> attrs) throws Exception {
  Collection< ? extends Builder> builders = getSubBuilders();
  for (Builder sub : builders) {
    if (sub.getBsn().equals(bsn))
      return new Container(this, getOutputFile(bsn, sub.getVersion()));
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public Map<String, Version> getVersions() throws Exception {
  if (versionMap.isEmpty()) {
    try (ProjectBuilder pb = getBuilder(null)) {
      for (Builder builder : pb.getSubBuilders()) {
        String v = builder.getVersion();
        if (v == null)
          v = "0";
        else {
          v = Analyzer.cleanupVersion(v);
          if (!Verifier.isVersion(v))
            continue; // skip
        }
        Version version = new Version(v);
        versionMap.put(builder.getBsn(), version);
      }
    }
  }
  return new LinkedHashMap<>(versionMap);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Answer the container associated with a given bsn.
 *
 * @throws Exception
 */
public Container getDeliverable(String bsn, Map<String, String> attrs) throws Exception {
  try (ProjectBuilder pb = getBuilder(null)) {
    for (Builder b : pb.getSubBuilders()) {
      if (b.getBsn()
        .equals(bsn))
        return new Container(this, getOutputFile(bsn, b.getVersion()), attrs);
    }
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Answer the container associated with a given bsn.
 *
 * @throws Exception
 */
public Container getDeliverable(String bsn, Map<String, String> attrs) throws Exception {
  try (ProjectBuilder pb = getBuilder(null)) {
    for (Builder b : pb.getSubBuilders()) {
      if (b.getBsn()
        .equals(bsn))
        return new Container(this, getOutputFile(bsn, b.getVersion()), attrs);
    }
  }
  return null;
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 * 
 * @return
 */
void sign(@SuppressWarnings("unused") Jar jar) throws Exception {
  String signing = getProperty("-sign");
  if (signing == null)
    return;
  trace("Signing %s, with %s", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String,Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 *
 * @return
 */
void sign(@SuppressWarnings("unused")
Jar jar) throws Exception {
  String signing = getProperty(SIGN);
  if (signing == null)
    return;
  trace("Signing %s, with %s", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String,Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

相关文章

Builder类方法