Refine search
/** * 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);
/** * Creates a document for the given mime type. * @param mimeType the MIME type * @return document instance or {@code null} */ @CheckForNull public Document createDocument(@NonNull String mimeType);
/** * 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);
/** * Checks if given folder can be converted into a {@link Project}. * Called only for folders accepted by the {@link ProjectConvertor.Registration#requiredPattern}. * @param projectDirectory the folder to check * @return the {@link ProjectConvertor.Result} if the folder can be * converted to a {@link Project} or null. */ @CheckForNull Result isProject(@NonNull FileObject projectDirectory);
/** * Returns a {@link FileObject} for given {@link Document}. * @param document the {@link Document} to find {@link FileObject} for * @return the {@link FileObject} or {@code null} */ @CheckForNull public FileObject getFileObject(@NonNull Document document);
/** * Returns the value of the variable or <code>null</code>. * * @param name the name of the variable * @return the value of the variable or <code>null</code> */ @CheckForNull String getVariable(@NonNull String name);
/** * Returns a service of given type registered in this transaction context. * @param type the type of the service * @return the service or null if no service of given type is registered */ @CheckForNull public <T extends Service> T get(@NonNull final Class<T> type) { return type.cast(services.get(type)); }
@CheckForNull private static URI toURI (@NonNull final URL url) { try { return url.toURI(); } catch (URISyntaxException e) { Exceptions.printStackTrace(e); return null; } }
@Override @CheckForNull public Void scan(@NonNull final Tree node, @NonNull final Map<Pair<BinaryName,String>, UsagesData<String>> p) { if (node == null) { return null; } super.scan (node,p); return null; }
@CheckForNull public URL findSibling(@NonNull final Collection<? extends URL> candidates) { URL res = null; for (URL candiate : candidates) { if (root == null || FileObjects.isParentOf(root, candiate)) { res = candiate; break; } } return res; }
@CheckForNull private static URL getOwnerRoot (@NonNull final URL source, @NonNull final URL root) throws URISyntaxException { assert source != null; assert root != null; if (FileObjects.isParentOf(root, source)) { return root; } else { return null; } }
@Override @CheckForNull public JavaFileObject getFile(@NonNull String name) throws IOException { if (separator != FileObjects.NBFS_SEPARATOR_CHAR) { name = name.replace(FileObjects.NBFS_SEPARATOR_CHAR, separator); } final Path target = root.resolve(name); return Files.exists(target) ? FileObjects.pathFileObject(target, root, rootURI, null) : null; }
@CheckForNull private CharSequence getNonExistent(@NonNull final CharSequence name) { for (int index = name.length(); index > 0; index = getNextPoint(name,index)) { final CharSequence subName = name.subSequence(0, index); if (nonExistent.containsKey(subName)) { return subName; } } return null; }
/**Find the name (the name after {@code #}) that is being referenced by the given {@link ReferenceTree}. * * @param path the leaf must be {@link ReferenceTree} * @return the referred member name, or {@code null} if none. * @since 0.124 */ public @CheckForNull Name getReferenceName(@NonNull DocTreePath path) { return ((DCReference) path.getLeaf()).memberName; }
@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; }
@CheckForNull static String readPassword(@NonNull final String url) { char[] passwordChars = Keyring.read(getPasswordKey(url)); if (passwordChars != null) { String password = String.valueOf(passwordChars); Arrays.fill(passwordChars, ' '); return password; } return null; }
@CheckForNull @Override public ModelResolver create( @NonNull final ParserResult result, @NonNull final OccurrenceBuilder occurrenceBuilder) { final JsonParser.JsonContext parseTree = result.getLookup().lookup(JsonParser.JsonContext.class); if (parseTree == null) { return null; } return new JsonModelResolver(result, occurrenceBuilder); } }
@CheckForNull private static ClassNode findReturnTypeFor( @NonNull ClassNode callerType, @NonNull String methodName, @NonNull Expression arguments) { MethodNode possibleMethod = callerType.tryFindPossibleMethod(methodName, arguments); if (possibleMethod != null) { return possibleMethod.getReturnType(); } return null; } }
@CheckForNull Profile profileForType(@NonNull final ClassName className) { final String binName = className.getInternalName(); Object res = cache.get(binName); if (res == null) { res = findProfile(binName); cache.put(binName, res); } return res == UNKNOWN ? null : (Profile) res; }
@Override @CheckForNull public Void visitErroneous(@NonNull final ErroneousTree tree, @NonNull final Map<Pair<BinaryName,String>, UsagesData<String>> p) { List<? extends Tree> trees = tree.getErrorTrees(); for (Tree t : trees) { this.scan(t,p); } return null; }