org.netbeans.api.annotations.common.NonNull类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(113)

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

NonNull介绍

暂无

代码示例

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

@CheckForNull
public static Command forName(@NonNull final String name) {
  Parameters.notNull("name", name);   //NOI18N
  return commands.get(name.toUpperCase());
}

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

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

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

/**
 * Run this executable with the given execution descriptor and optional output processor factory.
 * <p>
 * @param executionDescriptor execution descriptor to be used
 * @param outProcessorFactory output processor factory to be used, can be {@code null}
 * @return task representing the actual run, value representing result of the {@link Future} is exit code of the process
 * or {@code null} if the executable cannot be run
 * @see #run()
 * @see #run(ExecutionDescriptor)
 * @see #run(ExecutionDescriptor, ExecutionDescriptor.InputProcessorFactory)
 * @see ExecutionService#run()
 * @since 0.2
 */
@CheckForNull
public Future<Integer> run(@NonNull ExecutionDescriptor executionDescriptor, @NullAllowed ExecutionDescriptor.InputProcessorFactory outProcessorFactory) {
  Parameters.notNull("executionDescriptor", executionDescriptor); // NOI18N
  return runInternal(executionDescriptor, outProcessorFactory, false);
}

代码示例来源: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.modules/org-netbeans-modules-php-api-testing

/**
 * Create project customizer for the given PHP module.
 * @param phpModule the PHP module; never {@code null}
 * @return project customizer, can be {@code null} if not supported
 * @since 0.8
 */
@CheckForNull
ProjectCustomizer.CompositeCategoryProvider createCustomizer(@NonNull PhpModule phpModule);

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

public static @CheckForNull JavaSource forFileObject(@NonNull FileObject fileObject) throws IllegalArgumentException {
  if (fileObject == null) {
    throw new IllegalArgumentException ("fileObject == null");  //NOI18N
  if (!fileObject.isValid()) {
    LOGGER.log(Level.FINE, "FileObject ({0}) passed to JavaSource.forFileObject is invalid", fileObject.toURI().toString());
    return null;
    if (   fileObject.getFileSystem().isDefault()
      && fileObject.getAttribute("javax.script.ScriptEngine") != null
      && fileObject.getAttribute("template") == Boolean.TRUE) {

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

@CheckForNull
ProjectConvertor.Result isProject(@NonNull final FileObject folder) {
  for (FileObject fo : folder.getChildren()) {
    if (requiredPattern.matcher(fo.getNameExt()).matches()) {
      return getProjectConvertor().isProject(folder);
    }
  }
  return null;
}

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

@CheckForNull
@Override
public String findMIMEType(@NonNull final FileObject fo) {
  final String ext = fo.getExt();
  final String nameWithExt = fo.getNameExt().toLowerCase();
  return FILE_NAME.equalsIgnoreCase(ext) || nameWithExt.startsWith(FILE_NAME)?
    MIME_TYPE :
    null;
}

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

CachedZipFileObject(
      @NonNull final ZipFile zipFile,
      @NullAllowed final String pathToRootInArchive,
      @NonNull final String folderName,
      @NonNull final String baseName,
      final long mtime) {
    super (pathToRootInArchive, folderName, baseName, mtime);
    assert zipFile != null : "archiveFile == null";   //NOI18N
  this.zipFile = zipFile;
}

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

/**
 * Get common root of the given file objects.
 * @param fo1 first fileobject
 * @param fo2 second fileobject
 * @return common root of the given file objects, {@code null} if there is none
 * @since 2.31
 */
@CheckForNull
public static FileObject getCommonRoot(@NonNull FileObject fo1, @NonNull FileObject fo2) {
  Parameters.notNull("fo1", fo1); // NOI18N
  Parameters.notNull("fo2", fo2); // NOI18N
  FileObject tmp = fo1;
  while (tmp != null) {
    if (tmp.equals(fo2)
        || FileUtil.isParentOf(tmp, fo2)) {
      return tmp;
    }
    tmp = tmp.getParent();
  }
  return null;
}

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

/**
 * Handles exception. When exception is thrown from the non initialized index,
 * the index has not been checked if it's corrupted. If it's corrupted don't display
 * the error to user just log it. The index will be recovered during the scan.
 * @param ret ret value
 * @param e exception
 * @return ret
 * @throws Exception 
 */
@CheckForNull
protected final <R, E extends Exception> R handleException (
    @NullAllowed final R ret,
    @NonNull final E e,
    @NullAllowed final URL root) throws E {
  if (State.NEW == getState()) {
    LOG.log(Level.FINE, "Exception from non initialized index", e); //NOI18N
    return ret;
  } else {
    throw Exceptions.attachMessage(e, "Index state: " + state + ", Root: " + root); //NOI18N
  }
}

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

/**
 * Finds the owning non convertor project.
 * Finds nearest enclosing non convertor project.
 * @param file the {@link FileObject} to find owner for
 * @return the owning {@link Project} or null if there is no such a project.
 * @since 1.82
 */
@CheckForNull
@SuppressWarnings("NestedAssignment")
public static Project getNonConvertorOwner(@NonNull final FileObject file) {
  for (FileObject parent = file; parent != null; parent = parent.getParent()) {
    final Project prj = FileOwnerQuery.getOwner(parent);
    if (prj == null || !isConvertorProject(prj)) {
      return prj;
    }
  }
  return null;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javascript2-doc

/**
 * Create new annotation tag with documentation.
 * @param name tag name; never {@code null}
 * @param insertTemplate text that it inserted to the source file; never {@code null}
 * @param documentation documentation of the tag, HTML allowed; can be {@code null}
 */
public AnnotationCompletionTag(@NonNull String name, @NonNull String insertTemplate, @NullAllowed String documentation) {
  Parameters.notEmpty("name", name);
  Parameters.notEmpty("insertTemplate", insertTemplate);
  this.name = name;
  this.insertTemplate = insertTemplate;
  this.documentation = documentation;
}

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

@CheckForNull
Key createKey(@NonNull final URL rootURL) {
  final URL fileURL = FileUtil.getArchiveFile(rootURL);
  if (fileURL == null) {
    //Not an archive
    return null;
  }
  final FileObject fileFo = URLMapper.findFileObject(fileURL);
  if (fileFo == null) {
    return null;
  }
  return new Key(
    fileFo.toURI(),
    fileFo.lastModified().getTime(),
    fileFo.getSize());
}

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

@CheckForNull
protected URL map(@NonNull final FileObject fo) {
  return fo.toURL();
}

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

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

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep

/**
 * Run this executable with the given execution descriptor and optional output processor factory.
 * <p>
 * @param executionDescriptor execution descriptor to be used
 * @param outProcessorFactory output processor factory to be used, can be {@code null}
 * @return task representing the actual run, value representing result of the {@link Future} is exit code of the process
 * or {@code null} if the executable cannot be run
 * @see #run()
 * @see #run(ExecutionDescriptor)
 * @see #run(ExecutionDescriptor, ExecutionDescriptor.InputProcessorFactory)
 * @see ExecutionService#run()
 * @since 0.2
 */
@CheckForNull
public Future<Integer> run(@NonNull ExecutionDescriptor executionDescriptor, @NullAllowed ExecutionDescriptor.InputProcessorFactory outProcessorFactory) {
  Parameters.notNull("executionDescriptor", executionDescriptor); // NOI18N
  return runInternal(executionDescriptor, outProcessorFactory);
}

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

/**
 * Returns a {@link Document} for the given {@link FileObject}.
 * @param file the {@link FileObject} to create {@link Document} for
 * @return the document instance or {@code null}
 */
@CheckForNull
public Document getDocument(@NonNull FileObject file);

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

protected PrefetchableBase(
    @NonNull final String pkgName,
    @NonNull final String name,
    @NullAllowed final Charset encoding,
    final boolean caseSensitive) {
  super(pkgName, name, encoding, caseSensitive);
}

相关文章

NonNull类方法