当前位置: 首页>>代码示例>>Java>>正文


Java Parameters.notNull方法代码示例

本文整理汇总了Java中org.openide.util.Parameters.notNull方法的典型用法代码示例。如果您正苦于以下问题:Java Parameters.notNull方法的具体用法?Java Parameters.notNull怎么用?Java Parameters.notNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.util.Parameters的用法示例。


在下文中一共展示了Parameters.notNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createProject

import org.openide.util.Parameters; //导入方法依赖的package包/类
public static AntProjectHelper createProject(final File dir, final String name,
                                              final File[] sourceFolders, final File[] testFolders, 
                                              final String manifestFile, final String librariesDefinition,
                                              final String buildXmlName) throws IOException {
    Parameters.notNull("dir", dir); //NOI18N
    Parameters.notNull("name", name);   //NOI8N
    Parameters.notNull("sourceFolders", sourceFolders); //NOI18N
    Parameters.notNull("testFolders", testFolders); //NOI18N
    return new J2SEProjectBuilder(dir, name).
            addSourceRoots(sourceFolders).
            addTestRoots(testFolders).
            skipTests(testFolders.length == 0).
            setManifest(manifestFile).
            setLibrariesDefinitionFile(librariesDefinition).
            setBuildXmlName(buildXmlName).
            setSourceLevel(defaultSourceLevel).
            setJavaPlatform(getPlatform()).
            build();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:J2SEProjectGenerator.java

示例2: execute

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Execute the given command with given parameters. Please refer to the documentation
 * of the given command for supported properties.
 *
 * @param command command to execute
 * @param props properties
 * @param toRun file to run
 * @throws java.io.IOException if execution fails
 * @throws java.lang.UnsupportedOperationException if the given command is not supported
 *
 * @since 1.22
 */
public static ExecutorTask execute(String command, Map<String, ?> properties) throws IOException, UnsupportedOperationException {
    Parameters.notNull("command", command);
    Parameters.notNull("properties", properties);
    
    final Collection<? extends JavaRunnerImplementation> runners = Lookup.getDefault().lookupAll(JavaRunnerImplementation.class);
    for (JavaRunnerImplementation i : runners) {
        if (i.isSupported(command, properties)) {
            return i.execute(command, properties);
        }
    }

    throw new UnsupportedOperationException(MessageFormat.format(
        "command: {0}, JavaRunner impls: {1}",  //NOI18N
        command,
        runners));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:JavaRunner.java

示例3: R

import org.openide.util.Parameters; //导入方法依赖的package包/类
R(
        @NonNull final URL url,
        @NonNull final MultiModule modules,
        @NonNull final String moduleName,
        @NonNull final String[] templates) {
    Parameters.notNull("url", url);             //NOI18N
    Parameters.notNull("modules", modules); //NOI18N
    Parameters.notNull("moduleName", moduleName);   //NOI18N
    Parameters.notNull("templates", templates);         //NOI18N
    this.url = url;
    this.pp = new EvaluatorPropertyProvider(MultiModuleBinaryForSourceQueryImpl.this.evaluator);
    this.evaluator = PropertyUtils.sequentialPropertyEvaluator(
        PropertyUtils.fixedPropertyProvider(Collections.singletonMap("module.name",moduleName)), //NOI18N
        pp);
    this.modules = modules;
    this.moduleName = moduleName;
    this.templates = templates;
    this.cache = new AtomicReference();
    this.listeners = new ChangeSupport(this);
    this.propsCache = new AtomicReference<>();
    this.scp = new AtomicReference<>();
    MultiModuleBinaryForSourceQueryImpl.this.evaluator.addPropertyChangeListener(WeakListeners.propertyChange(this, MultiModuleBinaryForSourceQueryImpl.this.evaluator));
    this.modules.addPropertyChangeListener(WeakListeners.propertyChange(this, this.modules));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:MultiModuleBinaryForSourceQueryImpl.java

示例4: setTestModulepathProperties

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Sets test module path properties.
 * @param modulePathProperties  the names of properties containing the test module path, by default {@link ProjectProperties#JAVAC_TEST_MODULEPATH}
 * @return {@link Builder}
 * @since 1.77
 */
@NonNull
public Builder setTestModulepathProperties(@NonNull final String[] modulePathProperties) {
    Parameters.notNull("modulePathProperties", modulePathProperties);
    this.testModulePath = Arrays.copyOf(modulePathProperties, modulePathProperties.length);
    return this;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ClassPathProviderImpl.java

示例5: removeDocuments

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Removes all documents for given indexables
 * @param indexable to be removed
 */
public void removeDocuments (final Indexable indexable) {
    Parameters.notNull("indexable", indexable); //NOI18N
    if (spiIndex != null) {
        spiIndex.removeDocument (indexable.getRelativePath());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:IndexingSupport.java

示例6: OK

import org.openide.util.Parameters; //导入方法依赖的package包/类
OK (@NonNull final ResolveBrokenRuntimePlatform panel) {
    super(NbBundle.getMessage(RuntimePlatformProblemsProvider.class,"LBL_OK"));
    Parameters.notNull("panel", panel);
    this.panel = panel;
    panel.addChangeListener(this);
    stateChanged(null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RuntimePlatformProblemsProvider.java

示例7: setModulepathProperties

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Sets module path properties.
 * @param modulepathProperties  the names of properties containing the module path, by default {@link ProjectProperties#JAVAC_MODULEPATH}
 * @return {@link Builder}
 */
@NonNull
public Builder setModulepathProperties(@NonNull final String[] modulepathProperties) {
    Parameters.notNull("modulePathProperties", modulepathProperties);
    this.modulePath = Arrays.copyOf(modulepathProperties, modulepathProperties.length);
    return this;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:MultiModuleClassPathProvider.java

示例8: customizerChanged

import org.openide.util.Parameters; //导入方法依赖的package包/类
@Override
public void customizerChanged(Project project, CssPreprocessorImplementation cssPreprocessor) {
    Parameters.notNull("project", project); // NOI18N
    Parameters.notNull("cssPreprocessor", cssPreprocessor); // NOI18N
    CssPreprocessor preprocessor = findCssPreprocessor(cssPreprocessor);
    if (preprocessor != null) {
        listenersSupport.fireCustomizerChanged(project, preprocessor);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:CssPreprocessors.java

示例9: createPackageSearchScope

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Creates a search scope limited to list of packages.
 * @param base the base search scope to restrict
 * @param pkgs a list of packages in which the search should be performed
 * @return a newly created search scope
 * @since 0.82
 */
@NonNull
public static SearchScopeType createPackageSearchScope(
        @NonNull final SearchScopeType base,
        @NonNull final String... pkgs) {
    Parameters.notNull("base", base);   //NOI18N
    Parameters.notNull("pkgs", pkgs);   //NOI18N
    final Set<String> pkgSet = new HashSet<String>(Arrays.asList(pkgs));
    final Set<? extends String> basePkgs = base.getPackages();
    if (basePkgs != null) {
        pkgSet.addAll(basePkgs);
    }
    final Set<String> newPkgs = Collections.unmodifiableSet(pkgSet);
    return new SearchScopeType() {
        @Override
        public Set<? extends String> getPackages() {
            return newPkgs;
        }

        @Override
        public boolean isSources() {
            return base.isSources();
        }

        @Override
        public boolean isDependencies() {
            return base.isDependencies();
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:ClassIndex.java

示例10: setJavacSourceProperty

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Sets javac source level property.
 * @param javacSource the name of the property containing the javac source level
 * @return {@link Builder}
 * @since 1.76
 */
@NonNull
public Builder setJavacSourceProperty(@NonNull final String javacSource) {
    Parameters.notNull("javacSource", javacSource); //NOI18N
    this.javacSource = javacSource;
    return this;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ClassPathProviderImpl.java

示例11: bindComponentToFile

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Bind given component and given file together.
 *
 * @param fileObject to bind
 * @param offset position at which content of the component will be virtually placed
 * @param length how many characters replace from the original file
 * @param component component to bind
 */
public static void bindComponentToFile(FileObject fileObject, int offset, int length, JTextComponent component) {
    Parameters.notNull("fileObject", fileObject); //NOI18N
    Parameters.notNull("component", component); //NOI18N
    if (!fileObject.isValid() || !fileObject.isData()) {
        return;
    }
    if (offset < 0 || offset > fileObject.getSize()) {
        throw new IllegalArgumentException("Invalid offset=" + offset + "; file.size=" + fileObject.getSize()); //NOI18N
    }
    if (length < 0 || offset + length > fileObject.getSize()) {
        throw new IllegalArgumentException("Invalid lenght=" + length + "; offset=" + offset + ", file.size=" + fileObject.getSize()); //NOI18N
    }
    bind(component, null, fileObject, offset, -1, -1, length, fileObject.getMIMEType());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:DialogBinding.java

示例12: SchedulerTaskCancelSupportImpl

import org.openide.util.Parameters; //导入方法依赖的package包/类
private SchedulerTaskCancelSupportImpl(@NonNull final CancelSupport cancelSupport) {
    Parameters.notNull("cancelSupport", cancelSupport); //NOI18N
    this.cancelSupport = cancelSupport;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:SchedulerTaskCancelSupportImpl.java

示例13: removePropertyChangeListener

import org.openide.util.Parameters; //导入方法依赖的package包/类
@Override
public void removePropertyChangeListener(@NonNull final PropertyChangeListener listener) {
    Parameters.notNull("listener", listener);   //NOI18N
    this.listeners.removePropertyChangeListener(listener);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ClassPathProviderImpl.java

示例14: removePropertyChangeListener

import org.openide.util.Parameters; //导入方法依赖的package包/类
@Override
public void removePropertyChangeListener(PropertyChangeListener listener) {
    Parameters.notNull("listener", listener);   //NOI18N
    this.support.removePropertyChangeListener(listener);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:FlaggedClassPathImpl.java

示例15: lazyListForFixes

import org.openide.util.Parameters; //导入方法依赖的package包/类
/**
 * Converts "normal" list of {@link Fix}es into {@link LazyFixList}
 * @param fixes
 * @return lazy
 */
public static @NonNull LazyFixList lazyListForFixes(@NonNull List<Fix> fixes) {
    Parameters.notNull("fixes", fixes);
    
    return new StaticFixList(fixes);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ErrorDescriptionFactory.java


注:本文中的org.openide.util.Parameters.notNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。