org.openide.util.Parameters.notNull()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(122)

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

Parameters.notNull介绍

[英]Asserts the parameter value is not null.

Use java.util.Objects.requireNonNull in JDK 7.
[中]断言参数值不是[$0$]。
使用java。util。物体。JDK 7中的requireNonNull。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-executable

/**
 * Set addition parameters for {@link #run() running}.
 * <p>
 * The default value is empty list (it means no additional parameters).
 * @param additionalParameters addition parameters for {@link #run() running}.
 * @return the PHP Executable instance itself
 */
public PhpExecutable additionalParameters(@NonNull List<String> additionalParameters) {
  Parameters.notNull("additionalParameters", additionalParameters); // NOI18N
  this.additionalParameters = additionalParameters;
  return this;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

/**
 * Creates a text stream from a given URL with no preopened stream.
 * @param url a URL
 */
public TextStream(@NonNull final URL url) {
  Parameters.notNull("url", url); //NOI18N
  this.urls = Collections.singletonList(url);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-projectuiapi-base

/**
 * Create a new {@code ProjectProblemsProviderSupport}.
 *
 * @param source an instance to be given as the source for events, never {@code null}
 */
public ProjectProblemsProviderSupport(@NonNull Object source) {
  Parameters.notNull("source", source);
  propertyChangeSupport = new PropertyChangeSupport(source);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-projectuiapi-base

/**
 * Add a listener to the listener list.
 * @param listener {@link PropertyChangeListener} to be added, never {@code null}
 * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
 */
public void addPropertyChangeListener(@NonNull PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);
  propertyChangeSupport.addPropertyChangeListener(listener);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-projectuiapi-base

@Override
public void addPropertyChangeListener(@NonNull final PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);   //NOI18N
  pcs.addPropertyChangeListener(listener);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-projectuiapi-base

@Override
public void removePropertyChangeListener(@NonNull final PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);   //NOI18N
  pcs.removePropertyChangeListener(listener);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-projectuiapi-base

/**
 * Remove a listener from the listener list.
 * @param listener {@link PropertyChangeListener} to be removed, never {@code null}
 * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
 */
public void removePropertyChangeListener(@NonNull PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);
  propertyChangeSupport.removePropertyChangeListener(listener);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-editor-document

/**
 * Removes a {@link PropertyChangeListener}.
 * @param listener the listener to be removed.
 */
public void removePropertyChangeListener(@NonNull final PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);   //NOI18N
  this.listeners.removePropertyChangeListener(listener);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

public void fileModified(@NonNull final URI file) {
  Parameters.notNull("file", file);   //NOI18N
  synchronized (lock) {
    LOG.log(
      Level.FINE,
      "fileModified: {0}",    //NOI18N
      file);
    final Set<URI> addInto = addedFiles != null ? addedFiles : files;
    addInto.add(file);
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

private void cacheUpdated(@NonNull final URI file) {
  Parameters.notNull("file", file);   //NOI18N
  synchronized (lock) {
    LOG.log(
      Level.FINE,
      "cacheUpdated: {0}",    //NOI18N
      file);
    assert removedFiles != null;
    removedFiles.add(file);
  }
  
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

TextStream(@NonNull final Collection<? extends URL> urls) {
  Parameters.notNull("urls", urls);   //NOI18N            
  final List<URL> tmpUrls = new ArrayList<>(urls.size());
  for (URL u : urls) {
    Parameters.notNull("urls[]", u);  //NOI18N
    tmpUrls.add(u);
  }
  if (tmpUrls.isEmpty()) {
    throw new IllegalArgumentException("At least one URL has to be given.");    //NOI18N
  }
  this.urls = Collections.unmodifiableList(tmpUrls);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-project-ui

private Reference(
    @NonNull final String classPathId,
    @NonNull final String rawId,
    @NullAllowed final Profile requiredProfile) {
  Parameters.notNull("classPathId", classPathId); //NOI18N
  Parameters.notNull("rawId", rawId);             //NOI18N
  this.classPathId = classPathId;
  this.rawId = rawId;
  this.requiredProfile = requiredProfile;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

public static <T> T writeAction(@NonNull final Callable<T> action) throws Exception {
  Parameters.notNull("action", action);   //NOI18N
  LOCK.writeLock().lock();
  try {
    LOG.log(Level.FINE, "Write locked by {0}", Thread.currentThread());  //NOI18N
    return action.call();
  } finally {
    LOCK.writeLock().unlock();
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

static CacheAttributesTransaction create(
    @NonNull final URL root,
    final boolean srcRoot,
    final boolean allFiles) {
  Parameters.notNull("root", root);   //NOI18N
  return new CacheAttributesTransaction(root, srcRoot, allFiles);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

/**
 * Creates a qualified identifier from an element. Simple name will automatically
 * be used if appropriate, adding any needed imports, following user's preferences.
 *
 * @param element the element to use.
 */
public @NonNull ExpressionTree QualIdent(@NonNull Element element) {
  Parameters.notNull("element", element);
  return delegate.QualIdent(element);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

/**
 * Creates a new Tree for a given TypeMirror.
 *
 * @param type       TypeMirror for which a Tree should be created
 * @see com.sun.source.tree.ExpressionTree
 */
public @NonNull Tree Type(@NonNull TypeMirror type) {
  Parameters.notNull("type", type);
  return delegate.Type(type);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

public static URL getSourceFolder(@NonNull final URL aptFolder) {
  Parameters.notNull("aptFolder", aptFolder); //NOI18N
  //Currently no SPI as single impl exists
  return getDefaultSourceFolder(aptFolder);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-csl-types

@NonNull
public static Documentation create(@NonNull String content, URL url) {
  Parameters.notNull("content", content);
  return new Documentation(content, url);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-project-ui

@Override
public void addPropertyChangeListener(@NonNull final PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);   //NOI18N
  problemsProviderSupport.addPropertyChangeListener(listener);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-project-ui

@Override
public void removePropertyChangeListener(@NonNull final PropertyChangeListener listener) {
  Parameters.notNull("listener", listener);   //NOI18N
  problemsProviderSupport.removePropertyChangeListener(listener);
}

相关文章