Java Code Examples for org.netbeans.api.java.classpath.ClassPath#Flag

The following examples show how to use org.netbeans.api.java.classpath.ClassPath#Flag . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClassPathProviderMerger.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Set<ClassPath.Flag> getFlags() {
    synchronized (this) {
        if (this.flagsCache != null) {
            return this.flagsCache;
        }
    }
    final Set<ClassPath.Flag> flags = EnumSet.noneOf(ClassPath.Flag.class);
    for (ProxyFilteringCPI impl : classPaths) {
        flags.addAll(impl.getClassPathFlags());
    }
    synchronized (this) {
        if (this.flagsCache == null) {
            flagsCache = Collections.unmodifiableSet(flags);
        }
        return this.flagsCache;
    }
}
 
Example 2
Source File: MuxClassPathImplementation.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@NonNull
public Set<ClassPath.Flag> getFlags() {
    Set<ClassPath.Flag> res;
    synchronized (this) {
        res = flagsCache;
    }
    if (res == null) {
        res = getActiveClassPath().getFlags();
        assert res != null;
        synchronized (this) {
            if (flagsCache == null) {
                flagsCache = res;
            } else {
                res = flagsCache;
            }
        }
    }
    return res;
}
 
Example 3
Source File: PathRegistry.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@NonNull
private static byte[] toDigest(
    @NonNull final ClassPath cp,
    @NonNull final MessageDigest md) {
    final StringBuilder sb = new StringBuilder();
    for (ClassPath.Flag flag : cp.getFlags()) {
        sb.append(flag.name()).
            append(File.pathSeparatorChar);
    }
    for (ClassPath.Entry e : cp.entries()) {
        sb.append(e.getURL().toExternalForm()).
            append(File.pathSeparatorChar);
    }
    try {
        return md.digest(sb.toString().getBytes());
    } finally {
        md.reset();
    }
}
 
Example 4
Source File: ModuleClassPaths.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Set<ClassPath.Flag> getFlags() {
    getResources(); //Compute incomplete status
    return incomplete ?
            EnumSet.of(ClassPath.Flag.INCOMPLETE) :
            Collections.emptySet();
}
 
Example 5
Source File: MuxClassPathImplementationTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NonNull
public MutableClassPathImpl add(@NonNull final ClassPath.Flag flag) {
    assert flag != null;
    if (flags.add(flag)) {
        cs.firePropertyChange(PROP_FLAGS, null, null);
    }
    return this;
}
 
Example 6
Source File: MuxClassPathImplementationTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NonNull
public MutableClassPathImpl remove(@NonNull final ClassPath.Flag flag) {
    assert flag != null;
    if (flags.remove(flag)) {
        cs.firePropertyChange(PROP_FLAGS, null, null);
    }
    return this;
}
 
Example 7
Source File: CompileClassPathImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Set<ClassPath.Flag> getFlags() {
    return incomplete ?
        EnumSet.of(ClassPath.Flag.INCOMPLETE) :
        Collections.<ClassPath.Flag>emptySet();
}
 
Example 8
Source File: TestCompileClassPathImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Set<ClassPath.Flag> getFlags() {
    return incomplete ?
        EnumSet.of(ClassPath.Flag.INCOMPLETE) :
        Collections.<ClassPath.Flag>emptySet();
}
 
Example 9
Source File: ClassPathProviderMerger.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NonNull
Set<ClassPath.Flag> getClassPathFlags() {
    return classpath.getFlags();
}
 
Example 10
Source File: ClassPathProviderMergerTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void add(ClassPath.Flag... flgs) {
    for (ClassPath.Flag flg : flgs) {
        flags.add(flg);
    }
    support.firePropertyChange(PROP_FLAGS, null, null);
}
 
Example 11
Source File: ClassPathProviderMergerTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void remove(ClassPath.Flag... flgs) {
    for (ClassPath.Flag flg : flgs) {
        flags.remove(flg);
    }
    support.firePropertyChange(PROP_FLAGS, null, null);
}
 
Example 12
Source File: ClassPathProviderMergerTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Set<ClassPath.Flag> getFlags() {
    return this.flags;
}
 
Example 13
Source File: MuxClassPathImplementationTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
@NonNull
public Set<ClassPath.Flag> getFlags() {
    return Collections.unmodifiableSet(flags);
}
 
Example 14
Source File: FlaggedClassPathImplementation.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the {@link ClassPath}'s flags.
 * @return the {@link Flag}s
 */
@NonNull
Set<ClassPath.Flag> getFlags();