本文整理了Java中org.openide.util.Parameters.notEmpty()
方法的一些代码示例,展示了Parameters.notEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parameters.notEmpty()
方法的具体详情如下:
包路径:org.openide.util.Parameters
类名称:Parameters
方法名:notEmpty
[英]Asserts the parameter value is neither null
nor an empty character sequence.
[中]断言参数值既不是null
也不是空字符序列。
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
/** Returns list of file extensions associated with specified MIME type. In
* other words files with those extensions are recognized as specified MIME type
* in NetBeans' filesystem. It never returns {@code null}.
* @param mimeType the MIME type (e.g. image/gif)
* @return list of file extensions associated with specified MIME type, never {@code null}
* @see #setMIMEType(String, String)
* @since org.openide.filesystems 7.18
*/
public static List<String> getMIMETypeExtensions(String mimeType) {
Parameters.notEmpty("mimeType", mimeType); //NOI18N
HashMap<String, String> extensionToMime = new HashMap<String, String>();
for (FileObject mimeResolverFO : MIMEResolverImpl.getOrderedResolvers()) {
Map<String, Set<String>> mimeToExtensions = MIMEResolverImpl.getMIMEToExtensions(mimeResolverFO);
for (Map.Entry<String, Set<String>> entry : mimeToExtensions.entrySet()) {
String mimeKey = entry.getKey();
Set<String> extensions = entry.getValue();
for (String extension : extensions) {
extensionToMime.put(extension, mimeKey);
}
}
}
List<String> registeredExtensions = new ArrayList<String>();
for (Map.Entry<String, String> entry : extensionToMime.entrySet()) {
if (entry.getValue().equals(mimeType)) {
registeredExtensions.add(entry.getKey());
}
}
return registeredExtensions;
}
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
Parameters.notEmpty("extension", extension); //NOI18N
final Map<String, Set<String>> mimeToExtensions = new HashMap<String, Set<String>>();
FileObject userDefinedResolverFO = MIMEResolverImpl.getUserDefinedResolver();
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-framework
/**
* Constructs a new exception with the specified detail failure message and cause.
* @param failureMessage the detail failure message.
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is permitted,
* and indicates that the cause is nonexistent or unknown.)
*/
public ExtendingException(String failureMessage, Throwable cause) {
super(failureMessage, cause);
Parameters.notEmpty("failureMessage", failureMessage);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep
/**
* Set display name that is used for executable running (as a title of the Output window).
* <p>
* The default value is {@link #getExecutable() executable} with {@link #getParameters() parameters}.
* @param displayName display name that is used for executable running
* @return the external executable instance itself
*/
public ExternalExecutable displayName(String displayName) {
Parameters.notEmpty("displayName", displayName); // NOI18N
this.displayName = displayName;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-executable
/**
* Set display name that is used for executable running (as a title of the Output window).
* <p>
* The default value is {@link #getExecutable() executable} with {@link #getParameters() parameters}.
* @param displayName display name that is used for executable running
* @return the PHP Executable instance itself
*/
public PhpExecutable displayName(String displayName) {
Parameters.notEmpty("displayName", displayName); // NOI18N
this.displayName = displayName;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-executable
/**
* Set identifier of the IDE PHP Options. If the executable is not {@link PhpExecutableValidator valid} and user should be
* {@link #warnUser(boolean) warned} about it, IDE Options are opened with this category selected.
* <p>
* The default value is {@code null} (the General PHP category).
* @param optionsSubcategory identifier of the IDE PHP Options
* @return the PHP Executable instance itself
*/
public PhpExecutable optionsSubcategory(String optionsSubcategory) {
Parameters.notEmpty("optionsSubcategory", optionsSubcategory); // NOI18N
this.optionsSubcategory = optionsSubcategory;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-testing
/**
* Remove custom parameter.
* @param key key of the parameter
*/
public void removeParameter(String key) {
Parameters.notEmpty("key", key); // NOI18N
parameters.remove(key);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-platform
public GemInfo(String name, String version, File specFile) {
Parameters.notEmpty("name", name);
Parameters.notEmpty("version", version);
Parameters.notNull("specFile", specFile);
this.name = name;
this.version = version;
this.specFile = specFile;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-phpmodule
/**
* Capitalizes first character of the passed input.
* <p>
* Example: foobarbaz -> Foobarbaz
* @param input text to be capitalized, never null or empty
* @return capitalized input string, never null
* @since 2.21
*/
public static String capitalize(String input) {
Parameters.notEmpty("input", input); //NOI18N
return input.substring(0, 1).toUpperCase() + input.substring(1);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-phpmodule
/**
* Decapitalizes first character of the passed input.
* <p>
* Example: Foobarbaz -> foobarbaz
* @param input text to be decapitalized, never null or empty
* @return decapitalized input string, never null
* @since 2.33
*/
public static String decapitalize(String input) {
Parameters.notEmpty("input", input); //NOI18N
return input.substring(0, 1).toLowerCase() + input.substring(1);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-executable
/**
* Set name of the executable. This name is used for {@link PhpExecutableValidator validation} only (before running).
* <p>
* The default value is {@code null} (it means "File").
* @param executableName name of the executable
* @return the PHP Executable instance itself
*/
public PhpExecutable executableName(@NonNull String executableName) {
Parameters.notEmpty("executableName", executableName); // NOI18N
this.executableName = executableName;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-testing
/**
* Set custom parameter.
* @param key key of the parameter
* @param value value of the parameter
*/
public void setParameter(String key, Object value) {
Parameters.notEmpty("key", key); // NOI18N
Parameters.notNull("value", value); // NOI18N
parameters.put(key, value);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep
/**
* Set name of the executable. This name is used for {@link ExternalExecutableValidator validation} only (before running).
* <p>
* The default value is {@code null} (it means "File").
* @param executableName name of the executable
* @return the external executable instance itself
*/
public ExternalExecutable executableName(@NonNull String executableName) {
Parameters.notEmpty("executableName", executableName); // NOI18N
this.executableName = executableName;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-refactoring
public RenameItem(@NonNull String newFqn, @NonNull String oldFqn, Problem problem) {
Parameters.notEmpty("newFqn", newFqn); //NO18N
Parameters.notEmpty("oldFqn", oldFqn); //NO18N
this.newFqn = newFqn;
this.oldFqn = oldFqn;
myProblem = problem;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-annotation
/**
* Create new annotation tag with documentation.
* @param name tag name; never {@code null}
* @param insertTemplate text that it inserted to the source file; never {@code null}
* @param documentation documentation of the tag, HTML allowed; can be {@code null}
*/
public AnnotationCompletionTag(@NonNull String name, @NonNull String insertTemplate, @NullAllowed String documentation) {
Parameters.notEmpty("name", name);
Parameters.notEmpty("insertTemplate", insertTemplate);
this.name = name;
this.insertTemplate = insertTemplate;
this.documentation = documentation;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javascript2-doc
/**
* Create new annotation tag with documentation.
* @param name tag name; never {@code null}
* @param insertTemplate text that it inserted to the source file; never {@code null}
* @param documentation documentation of the tag, HTML allowed; can be {@code null}
*/
public AnnotationCompletionTag(@NonNull String name, @NonNull String insertTemplate, @NullAllowed String documentation) {
Parameters.notEmpty("name", name);
Parameters.notEmpty("insertTemplate", insertTemplate);
this.name = name;
this.insertTemplate = insertTemplate;
this.documentation = documentation;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-phpmodule
/**
* Constructs a new exception with the specified detail failure message and cause.
* @param failureMessage the detail failure message.
* @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
* (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public ExtendingException(@NonNull String failureMessage, @NullAllowed Throwable cause) {
super(failureMessage, cause);
Parameters.notEmpty("failureMessage", failureMessage);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject
/**
* Set Site Root folder, never {@code null} or empty string.
*
* @param siteRootFolder Site Root folder, never {@code null} or empty string
* @return itself
* @since 1.37
*/
@NonNull
public CreateProjectProperties setSiteRootFolder(@NonNull String siteRootFolder) {
Parameters.notEmpty("siteRootFolder", siteRootFolder); // NOI18N
this.siteRootFolder = siteRootFolder;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject
/**
* Set project name, never {@code null} or empty string.
*
* @param projectName project name, never {@code null} or empty string
* @return itself
* @since 1.37
*/
@NonNull
public CreateProjectProperties setProjectName(@NonNull String projectName) {
Parameters.notEmpty("projectName", projectName); // NOI18N
this.projectName = projectName;
return this;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-editor
protected PhpBaseElement(@NonNull String name, @NullAllowed String fullyQualifiedName, @NullAllowed PhpClass type, @NullAllowed FileObject file, int offset, @NullAllowed String description) {
Parameters.notEmpty("name", name);
this.name = name;
this.fullyQualifiedName = fullyQualifiedName;
this.type = type;
this.file = file;
this.offset = offset;
this.description = description;
}
内容来源于网络,如有侵权,请联系作者删除!