本文整理汇总了Java中org.netbeans.api.annotations.common.NonNull类的典型用法代码示例。如果您正苦于以下问题:Java NonNull类的具体用法?Java NonNull怎么用?Java NonNull使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NonNull类属于org.netbeans.api.annotations.common包,在下文中一共展示了NonNull类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull
public static ConnectionMethod load(@NonNull final Map<String,String> props) {
final String host = props.get(PLAT_PROP_HOST);
if (host == null) {
throw new IllegalStateException("No platform host"); //NOI18N
}
final String _port = props.get(PLAT_PROP_PORT);
if (_port == null) {
throw new IllegalStateException("No platfrom port"); //NOI18N
}
try {
final int port = Integer.parseInt(_port);
return new ConnectionMethod(host, port, Authentification.load(props));
} catch (NumberFormatException nfe) {
throw new IllegalStateException("Invalid platfrom port: " + _port); //NOI18N
}
}
示例2: ComboDataSource
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
ComboDataSource(
@NonNull final String propName,
@NonNull final JLabel label,
@NonNull final JComboBox<PlatformKey> combo,
@NonNull final JComboBox<?> configCombo,
@NonNull final Map<String,Map<String,String>> configs) {
super(propName, label, configCombo, configs);
Parameters.notNull("combo", combo); //NOI18N
this.combo = combo;
this.combo.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
changed(getPropertyValue());
}
});
updateFont(getPropertyValue());
}
示例3: translate
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull Tree translate(final @NonNull Tree original, final @NonNull Map<? extends Tree, ? extends Tree> original2Translated, ImportAnalysis2 ia, Map<Tree, Object> tree2Tag) {
ImmutableTreeTranslator itt = new ImmutableTreeTranslator(info instanceof WorkingCopy ? (WorkingCopy)info : null) {
private @NonNull Map<Tree, Tree> map = new HashMap<Tree, Tree>(original2Translated);
@Override
public Tree translate(Tree tree) {
Tree translated = map.remove(tree);
if (translated != null) {
return translate(translated);
} else {
return super.translate(tree);
}
}
};
Context c = info.impl.getJavacTask().getContext();
itt.attach(c, ia, tree2Tag);
return itt.translate(original);
}
示例4: ResolvedJavaSymbolDescriptor
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
ResolvedJavaSymbolDescriptor (
@NonNull final JavaSymbolDescriptorBase base,
@NonNull final String simpleName,
@NullAllowed final String simpleNameSuffix,
@NullAllowed final String ownerName,
@NonNull final ElementKind kind,
@NonNull final Set<Modifier> modifiers,
@NonNull final ElementHandle<?> me) {
super(base, ownerName);
assert simpleName != null;
assert kind != null;
assert modifiers != null;
assert me != null;
this.simpleName = simpleName;
this.simpleNameSuffix = simpleNameSuffix;
this.kind = kind;
this.modifiers = modifiers;
this.me = me;
}
示例5: createFileManager
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull
private synchronized JavaFileManager createFileManager(@NullAllowed final String sourceLevel) {
final SiblingSource siblings = SiblingSupport.create();
final ProxyFileManager.Configuration cfg = ProxyFileManager.Configuration.create(
moduleBootPath,
cachedModuleCompilePath,
cachedBootClassPath,
moduleCompilePath.entries().isEmpty() ? cachedCompileClassPath : cachedModuleClassPath,
cachedSrcClassPath,
moduleSrcPath,
outputClassPath,
cachedAptSrcClassPath,
siblings,
fmTx,
pgTx);
cfg.setFilter(filter);
cfg.setIgnoreExcludes(ignoreExcludes);
cfg.setUseModifiedFiles(useModifiedFiles);
cfg.setCustomFileManagerProvider(jfmProvider);
for (Map.Entry<ClassPath,Function<URL,Collection<? extends URL>>> e : peerProviders.entrySet()) {
cfg.setPeers(e.getKey(), e.getValue());
}
cfg.setSourceLevel(sourceLevel);
return new ProxyFileManager(cfg);
}
示例6: scanRootFiles
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@org.netbeans.api.annotations.common.SuppressWarnings(
value="DMI_COLLECTION_OF_URLS",
justification="URLs have never host part")
private boolean scanRootFiles(
@NullAllowed final Map<URL, Set<FileObject>> files,
@NonNull final Set<URL> incompleteSeenRoots) {
if (files != null && files.size() > 0) { // #174887
for(Iterator<Map.Entry<URL, Set<FileObject>>> it = files.entrySet().iterator(); it.hasNext(); ) {
Map.Entry<URL, Set<FileObject>> entry = it.next();
URL root = entry.getKey();
if (incompleteSeenRoots.contains(root) ||
scanFiles(root, entry.getValue(), true, sourcesForBinaryRoots.contains(root))) {
it.remove();
} else {
return false;
}
}
}
return true;
}
示例7: parsePackage
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull
private static String parsePackage(FileObject file) {
String pkg = ""; //NOI18N
final JavacTaskImpl jt = JavacParser.createJavacTask(
new ClasspathInfo.Builder(ClassPath.EMPTY).build(),
null,
null,
null,
null,
null,
null,
null,
Collections.singletonList(FileObjects.fileObjectFileObject(
file,
file.getParent(),
null,
FileEncodingQuery.getEncoding(file))));
final CompilationUnitTree cu = jt.parse().iterator().next();
pkg = Optional.ofNullable(cu.getPackage())
.map((pt) -> pt.getPackageName())
.map((xt) -> xt.toString())
.orElse(pkg);
return pkg;
}
示例8: getJavadoc
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull
static synchronized QueriesCache<Javadoc> getJavadoc() {
if (javadoc == null) {
javadoc = new QueriesCache<Javadoc>(Javadoc.class);
}
return javadoc;
}
示例9: DescriptorChangeEvent
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
/**
* Creates a new event.
* @param source the originating descriptor
* @param replacement the descriptor replacement(s). In case of an empty {@link Collection}
* the originating descriptor is removed.
*/
public DescriptorChangeEvent(
@NonNull final T source,
@NonNull final Collection<? extends T> replacement) {
super(source);
Parameters.notNull("descriptors", replacement); //NOI18N
this.replacement = Collections.unmodifiableCollection(replacement);
}
示例10: AttachSourcePanel
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
public AttachSourcePanel(
@NonNull final URL root,
@NonNull final URL file,
@NonNull final String binaryName) {
assert root != null;
assert file != null;
assert binaryName != null;
this.root = root;
this.file = file;
this.binaryName = binaryName;
initComponents();
}
示例11: createMultiModuleFileBuiltQuery
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
/**
* Creates a {@link FileBuiltQueryImplementation} for a multi-module project.
* @param helper the {@link AntProjectHelper}
* @param evaluator the {@link PropertyEvaluator}
* @param sourceModules the module roots
* @param sourceRoots the source roots
* @param testModules the test module roots
* @param testRoots the test source roots
* @return the {@link FileBuiltQueryImplementation} instance
* @since 1.103
*/
@NonNull
public static FileBuiltQueryImplementation createMultiModuleFileBuiltQuery(
@NonNull final AntProjectHelper helper,
@NonNull final PropertyEvaluator evaluator,
@NonNull final SourceRoots sourceModules,
@NonNull final SourceRoots sourceRoots,
@NonNull final SourceRoots testModules,
@NonNull final SourceRoots testRoots) {
final MultiModule srcModel = MultiModule.getOrCreate(sourceModules, sourceRoots);
final MultiModule testModel = MultiModule.getOrCreate(testModules, testRoots);
return new MultiModuleFileBuiltQueryImpl(helper, evaluator, srcModel, testModel);
}
示例12: visit
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
/**
* Do a DFS traversal checking for cycles.
* @param encountered projects already encountered in the DFS
* @param curr current node to visit
* @param master the original master project (for use with candidate param)
* @param candidate a candidate added subproject for master, or null
*/
private static boolean visit(@NonNull Map<Project,Boolean> encountered, @NonNull Project curr, Project master, @NullAllowed Project candidate) {
if (encountered.containsKey(curr)) {
if (encountered.get(curr)) {
return false;
} else {
LOG.log(Level.FINE, "Encountered cycle in {0} from {1} at {2} via {3}", new Object[] {master, candidate, curr, encountered});
return true;
}
}
encountered.put(curr, false);
SubprojectProvider spp = curr.getLookup().lookup(SubprojectProvider.class);
if (spp != null) {
Set<? extends Project> subprojects = spp.getSubprojects();
LOG.log(Level.FINEST, "Found subprojects {0} from {1}", new Object[] {subprojects, curr});
for (Project child : subprojects) {
if (visit(encountered, child, master, candidate)) {
return true;
} else if (candidate == child) {
candidate = null;
}
}
}
if (candidate != null && curr == master) {
if (visit(encountered, candidate, master, candidate)) {
return true;
}
}
assert !encountered.get(curr);
encountered.put(curr, true);
return false;
}
示例13: getProjectConvertor
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull
private ProjectConvertor getProjectConvertor() {
final Object convertor = params.get(ATTR_DELEGATE);
if (!(convertor instanceof ProjectConvertor)) {
throw new IllegalStateException(String.format(
"Invalid ProjectConvertor: %s", //NOI18N
convertor));
}
return (ProjectConvertor) convertor;
}
示例14: updateBackground
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
@NonNull
public static <T extends JComponent> T updateBackground(@NonNull final T comp) {
if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
comp.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
}
return comp;
}
示例15: Hint
import org.netbeans.api.annotations.common.NonNull; //导入依赖的package包/类
public Hint(@NonNull Rule rule, @NonNull String description, @NonNull FileObject file, OffsetRange range, @NullAllowed List<HintFix> fixes, int priority) {
Parameters.notNull("rule", rule);
Parameters.notNull("description", description);
Parameters.notNull("file", file);
this.rule = rule;
this.description = description;
this.file = file;
this.range = range;
this.fixes = fixes;
this.priority = priority;
}