org.apache.tools.ant.Project.getReferences()方法的使用及代码示例

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

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

Project.getReferences介绍

[英]Return a map of the references in the project (String to Object). The returned hashtable is "live" and so must not be modified.
[中]返回项目中引用的映射(字符串到对象)。返回的哈希表是“活动”的,因此不能修改。

代码示例

代码示例来源:origin: org.apache.ant/ant

new HashMap<>(getProject().getReferences());
for (Reference ref : references) {
  String refid = ref.getRefId();
  Map<String, Object> newReferences = newProject.getReferences();
  for (String key : thisReferences.keySet()) {
    if (newReferences.containsKey(key)) {

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

/**
 * Copy references from one project to another.
 *
 * @param fromProject
 * @param toProject
 */
public static void copyReferences( Project fromProject, Project toProject )
{
  copyReferences( fromProject.getReferences(), toProject );
}

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

/**
 * Try to get all the poms with id's which have been added to the ANT project
 * @return
 */
public List/*<Pom>*/ getAntReactorPoms()
{
  List result = new ArrayList();
  Iterator i = getProject().getReferences().values().iterator();
  while ( i.hasNext() )
  {
    Object ref = i.next();
    if ( ref instanceof Pom )
    {
      result.add( (Pom)ref );
    }
  }
  return result;
}

代码示例来源:origin: org.apache.ivy/ivy

public void setProject(Project p) {
  super.setProject(p);
  if ("ivy.instance".equals(id) && !getProject().getReferences().containsKey(id)) {
    // register ourselfs as default settings, just in case the id attribute is not set
    getProject().addReference("ivy.instance", this);
    autoRegistered = true;
  }
}

代码示例来源:origin: org.gradle/gradle-core

public void close() {
  Project project = getProject();
  project.fireBuildFinished(null);
  ComponentHelper helper = ComponentHelper.getComponentHelper(project);
  helper.getAntTypeTable().clear();
  helper.getDataTypeDefinitions().clear();
  project.getReferences().clear();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui

private ICompletionProposal[] getReferencesValueProposals(String prefix) {
  Project project = antModel.getProjectNode().getProject();
  Map<String, Object> references = project.getReferences();
  if (references.isEmpty()) {
    return NO_PROPOSALS;

代码示例来源:origin: org.gradle/gradle-core

public Map<String, Object> getReferences() {
  ObservableMap map = new ObservableMap(getProject().getReferences());
  map.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent event) {
      getProject().addReference(event.getPropertyName(), event.getNewValue());
    }
  });
  @SuppressWarnings("unchecked") Map<String, Object> castMap = (Map<String, Object>) map;
  return castMap;
}

代码示例来源:origin: org.apache.ivy/ivy

public void setId(String id) {
  if (autoRegistered && getProject().getReference(this.id) == this) {
    getProject().getReferences().remove(this.id);
    autoRegistered = false;
  }
  this.id = id;
  if (getProject() != null) {
    getProject().addReference(this.id, this);
  }
}

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

/**
 * Perform the tag processing. Look up the path by {@link #getId id} and append
 * the {@link #getRefid other path} to it.
 *
 * @param output used to write output
 * @throws JellyTagException when anything goes wrong.
 */
public void doTag( XMLOutput output )
  throws JellyTagException
{
  Project project = AntTagLibrary.getProject( getContext() );
  if ( project == null )
  {
    throw new JellyTagException( "cannot find ant project" );
  }
  checkAttribute( getId(), "id" );
  checkAttribute( getRefid(), "refid" );
  Path path = (Path) project.getReferences().get( getId() );
  if ( path == null )
  {
    throw new JellyTagException( "cannot find the path to add to specified by 'id': " + getId() );
  }
  Path addPath = (Path) project.getReferences().get( getRefid() );
  if ( addPath == null )
  {
    throw new JellyTagException( "cannot find the path to add specified by 'refid': " + getRefid() );
  }
  path.append( addPath );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui

Map<String, Object> references = project.getReferences();
references.remove("ant.parsing.context"); //$NON-NLS-1$
ProjectHelper.setAntModel(this);

相关文章