Refine search
@CheckForNull public static Command forName(@NonNull final String name) { Parameters.notNull("name", name); //NOI18N return commands.get(name.toUpperCase()); }
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; }
/** * 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); }
/** * 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); }
/** * 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);
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) {
@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; }
@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; }
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; }
/** * 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; }
/** * 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 } }
/** * 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; }
/** * 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; }
@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()); }
@CheckForNull protected URL map(@NonNull final FileObject fo) { return fo.toURL(); }
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; }
/** * 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); }
/** * 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); }
/** * 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);
protected PrefetchableBase( @NonNull final String pkgName, @NonNull final String name, @NullAllowed final Charset encoding, final boolean caseSensitive) { super(pkgName, name, encoding, caseSensitive); }