Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This file is part of ClassGraph.
*
* Author: Luke Hutchison
*
* Hosted at: https://github.com/classgraph/classgraph
*
* --
*
* The MIT License (MIT)
*
* Copyright (c) 2019 Luke Hutchison
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
* EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*/
package nonapi.io.github.classgraph.scanspec;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URI;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import io.github.classgraph.ClassGraph.ClasspathElementFilter;
import io.github.classgraph.ClassGraph.ClasspathElementURLFilter;
import io.github.classgraph.ClassInfo;
import io.github.classgraph.ModulePathInfo;
import io.github.classgraph.ScanResult;
import nonapi.io.github.classgraph.scanspec.AcceptReject.AcceptRejectLeafname;
import nonapi.io.github.classgraph.scanspec.AcceptReject.AcceptRejectPrefix;
import nonapi.io.github.classgraph.scanspec.AcceptReject.AcceptRejectWholeString;
import nonapi.io.github.classgraph.utils.LogNode;
/**
* The scanning specification.
*/
public class ScanSpec {
/** Package accept/reject criteria (with separator '.'). */
public AcceptRejectWholeString packageAcceptReject = new AcceptRejectWholeString('.');
/** Package prefix accept/reject criteria, for recursive scanning (with separator '.', ending in '.'). */
public AcceptRejectPrefix packagePrefixAcceptReject = new AcceptRejectPrefix('.');
/** Path accept/reject criteria (with separator '/'). */
public AcceptRejectWholeString pathAcceptReject = new AcceptRejectWholeString('/');
/** Path prefix accept/reject criteria, for recursive scanning (with separator '/', ending in '/'). */
public AcceptRejectPrefix pathPrefixAcceptReject = new AcceptRejectPrefix('/');
/** Class accept/reject criteria (fully-qualified class names, with separator '.'). */
public AcceptRejectWholeString classAcceptReject = new AcceptRejectWholeString('.');
/** Classfile accept/reject criteria (path to classfiles, with separator '/', ending in ".class"). */
public AcceptRejectWholeString classfilePathAcceptReject = new AcceptRejectWholeString('/');
/** Package containing accept/reject criteriaed classes (with separator '.'). */
public AcceptRejectWholeString classPackageAcceptReject = new AcceptRejectWholeString('.');
/** Path to accept/reject criteriaed classes (with separator '/'). */
public AcceptRejectWholeString classPackagePathAcceptReject = new AcceptRejectWholeString('/');
/** Module accept/reject criteria (with separator '.'). */
public AcceptRejectWholeString moduleAcceptReject = new AcceptRejectWholeString('.');
/** Jar accept/reject criteria (leafname only, ending in ".jar"). */
public AcceptRejectLeafname jarAcceptReject = new AcceptRejectLeafname('/');
/** Classpath element resource path accept/reject criteria. */
public AcceptRejectWholeString classpathElementResourcePathAcceptReject = //
new AcceptRejectWholeString('/');
/** lib/ext jar accept/reject criteria (leafname only, ending in ".jar"). */
public AcceptRejectLeafname libOrExtJarAcceptReject = new AcceptRejectLeafname('/');
// -------------------------------------------------------------------------------------------------------------
/** If true, scan jarfiles. */
public boolean scanJars = true;
/** If true, scan nested jarfiles (jarfiles within jarfiles). */
public boolean scanNestedJars = true;
/** If true, scan directories. */
public boolean scanDirs = true;
/** If true, scan modules. */
public boolean scanModules = true;
/** If true, scan classfile bytecodes, producing {@link ClassInfo} objects. */
public boolean enableClassInfo;
/**
* If true, enables the saving of field info during the scan. This information can be obtained using
* {@link ClassInfo#getFieldInfo()}. By default, field info is not scanned, for efficiency.
*/
public boolean enableFieldInfo;
/**
* If true, enables the saving of method info during the scan. This information can be obtained using
* {@link ClassInfo#getMethodInfo()}. By default, method info is not scanned, for efficiency.
*/
public boolean enableMethodInfo;
/**
* If true, enables the saving of annotation info (for class, field, method or method parameter annotations)
* during the scan. This information can be obtained using {@link ClassInfo#getAnnotationInfo()} etc. By
* default, annotation info is not scanned, for efficiency.
*/
public boolean enableAnnotationInfo;
/** Enable the storing of constant initializer values for static final fields in ClassInfo objects. */
public boolean enableStaticFinalFieldConstantInitializerValues;
/** If true, enables the determination of inter-class dependencies. */
public boolean enableInterClassDependencies;
/**
* If true, allow external classes (classes outside of accepted packages) to be returned in the ScanResult, if
* they are directly referred to by an accepted class, as a superclass, implemented interface or annotation.
* Disabled by default.
*/
public boolean enableExternalClasses;
/**
* If true, system jarfiles (rt.jar) and system packages and modules (java.*, jre.*, etc.) should be scanned .
*/
public boolean enableSystemJarsAndModules;
/**
* If true, ignore class visibility. If false, classes must be public to be scanned.
*/
public boolean ignoreClassVisibility;
/**
* If true, ignore field visibility. If false, fields must be public to be scanned.
*/
public boolean ignoreFieldVisibility;
/**
* If true, ignore method visibility. If false, methods must be public to be scanned.
*/
public boolean ignoreMethodVisibility;
/**
* If true, don't scan runtime-invisible annotations (only scan annotations with RetentionPolicy.RUNTIME).
*/
public boolean disableRuntimeInvisibleAnnotations;
/**
* If true, when classes have superclasses, implemented interfaces or annotations that are external classes,
* those classes are also scanned. (Even though this slows down scanning a bit, there is no API for disabling
* this currently, since disabling it can lead to problems -- see #261.)
*/
public boolean extendScanningUpwardsToExternalClasses = true;
/**
* URL schemes that are allowed in classpath elements (not counting the optional "jar:" prefix and/or "file:",
* which are automatically allowed).
*/
public Set allowedURLSchemes;
// -------------------------------------------------------------------------------------------------------------
/**
* If non-null, specifies manually-added classloaders that should be searched after the context classloader(s).
*/
public transient List addedClassLoaders;
/**
* If non-null, this list of ClassLoaders will be searched instead of the visible/context ClassLoader(s). In
* particular, this causes ClassGraph to ignore the java.class.path system property.
*/
public transient List overrideClassLoaders;
/**
* If non-null, specifies manually-added ModuleLayers that should be searched after the visible ModuleLayers.
*/
public transient List