本文整理汇总了Java中org.jetbrains.annotations.NonNls类的典型用法代码示例。如果您正苦于以下问题:Java NonNls类的具体用法?Java NonNls怎么用?Java NonNls使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NonNls类属于org.jetbrains.annotations包,在下文中一共展示了NonNls类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Article
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
public Article(
int id,
@NotNull @NonNls LocalDate publishTime,
@NotNull Author author,
@NotNull Set<Tag> tags,
@NotNull @NonNls String title,
@NotNull @NonNls String brief,
@NotNull @NonNls String content,
int up,
int down,
int click) {
this.brief = brief;
this.title = title;
this.tags = tags;
this.id = id;
this.publishDate = publishTime;
this.content = content;
this.up = up;
this.down = down;
this.click = click;
this.author = author;
}
示例2: setName
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@Override
public PsiElement setName(@NonNls @NotNull String newElementName) throws IncorrectOperationException {
//todo implement this via rename refactor: RenamePsiElementProcessor & RenameHandler for each distinct selector
final int selectors = getParameters().size();
final String[] selectorNames = newElementName.split(":");
if (selectorNames.length == selectors) {
for (int index = 0; index < selectors; index++) {
AppleScriptIdentifier myId = getParameters().get(index).getSelectorNameIdentifier();
final AppleScriptIdentifier idNew = AppleScriptPsiElementFactory.createIdentifierFromText(getProject(), selectorNames[index]);
if (idNew != null) {
myId.replace(idNew);
}
}
} else {
AppleScriptIdentifier myIdentifier = getParameters().get(0).getSelectorNameIdentifier();
final AppleScriptIdentifier identifierNew = AppleScriptPsiElementFactory.createIdentifierFromText(getProject(), newElementName);
if (identifierNew != null) {
myIdentifier.replace(identifierNew);
}
}
return this;
}
示例3: verifyZhihuImportance
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
public boolean verifyZhihuImportance(@NotNull @NonNls String username) {
try {
IntTokenizer tokenizer = null;
Document page = Jsoup.parse(
new URL(String.format(ZhihuApiRoot,username)),
5000
);
Elements root = page.select("div[class='meta']");
tokenizer = IntTokenizer.of(root.text());
int reputationPoint = tokenizer.nextToken();
tokenizer.nextToken();
int likesPoint = tokenizer.nextToken();
return (reputationPoint >= 50 && likesPoint >= 40);
} catch (IOException e) {
throw new RuntimeException("unable to fetch data from zhihu", e);
}
}
示例4: findPsiClasses
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
private void findPsiClasses( @NotNull @NonNls String name, @NotNull GlobalSearchScope scope, Set<PsiClass> psiClasses, ManModule start, ManModule module )
{
for( ITypeManifold tm: module.getTypeManifolds() )
{
for( String fqn: tm.getAllTypeNames() )
{
String simpleName = ClassUtil.extractClassName( fqn );
if( simpleName.equals( name ) )
{
PsiClass psiClass = ManifoldPsiClassCache.instance().getPsiClass( scope, module, fqn );
if( psiClass == null )
{
return;
}
psiClasses.add( psiClass );
}
}
}
for( Dependency d : module.getDependencies() )
{
if( module == start || d.isExported() )
{
findPsiClasses( name, scope, psiClasses, start, (ManModule)d.getModule() );
}
}
}
示例5: verifyStackOverFlowAccount
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
public boolean verifyStackOverFlowAccount(@NotNull @NonNls String username) {
try {
String url = SOFApiRoot + String.format(
"users?order=asc&min=%s&max=%s&sort=name&inname=%s&site=stackoverflow",
username,
username,
username
);
HttpURLConnection conn = HttpURLConnection.class.cast(new URL(url).openConnection());
if (conn.getResponseCode() != 200) return false;
JSONTokener tokener = new JSONTokener(new GZIPInputStream(conn.getInputStream()));
// note that it was compressed
JSONObject object = JSONObject.class.cast(tokener.nextValue());
conn.disconnect();
return object.getJSONArray("items").length() != 0;
// 特判一下吧还是。。昨晚查询不存在用户返回的是200 ...和一个json
// 上面打这段注释的,没注意到我判断了返回的结果是否包含有效用户吗 =-= , bug 'fixed'
} catch (IOException e) {
throw new RuntimeException("unable to fetch data from stackoverflow", e);
}
}
示例6: select
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@NotNull
@Override
public ResultSet select(
@NotNull @NonNls String tableName,
@Nullable @NonNls String columnName,
@Nullable Pair... where) {
StringBuilder deepDarkFantasy = new StringBuilder(getQueryString(tableName, columnName));
if (where != null) {
deepDarkFantasy
.append(" WHERE ")
.append(String.join(" AND ", (CharSequence[]) Pair.convert(where)));
}
return querySQL(deepDarkFantasy.toString());
/*
return statement.executeQuery("SELECT " +
(columnName != null ? columnName : "*") +
" FROM " + tableName +
" WHERE " + String.join(" and ", Pair.convert(where))
);
// NOTICE: HERE I IGNORED THE CASE THAT WHERE IS NULL
*/
}
示例7: convert
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@Contract(pure = true)
@NotNull
@NonNls
public static String[] convert(Pair... origin) {
String[] ret = new String[origin.length];
for (int i = 0; i < ret.length; ++i) ret[i] = origin[i].getCombined();
return ret;
}
示例8: insert
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@Override
public synchronized boolean insert(
@NotNull @NonNls String tableName,
@NotNull @NonNls String... value) {
// TODO unsafe , needs to be fixed - phosphorus15
try {
// PreparedStatement preparedStatement = connection.prepareStatement();
String boyNextDoor = "INSERT INTO " + tableName + " VALUES ( ";
for (String val : value) execSQL(boyNextDoor + val + " )");
return true;
} catch (RuntimeException e) {
return false;
}
}
示例9: MySqlAdapter
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
private MySqlAdapter(@NotNull @NonNls String url) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
connection = DriverManager.getConnection(url, Constant.SERVER.DATABASE_USERNAME,
Constant.SERVER.DATABASE_PASSWORD);
connection.setAutoCommit(false);
statement = connection.createStatement();
} catch (Exception e) {
throw new RuntimeException("cannot connect to the database!", e);
}
}
示例10: getValidNumber
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
/**
* an OI-style reading method
*
* @param content raw
* @return parsed int
*/
@Contract(pure = true)
public static int getValidNumber(@NotNull @NonNls char[] content) {
int index = 0;
int result = 0;
int current = content[index++];
while (!(current >= '0' && current <= '9')) current = content[index++];
while (index <= content.length && current >= '0' && current <= '9') {
result = (result << 3) + (result << 1) + (current - '0'); // equal to result * 10
if (index >= content.length) break;
current = content[index++];
}
return result;
}
示例11: querySQL
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@NotNull
@Override
public ResultSet querySQL(
@NotNull @NonNls String sql) {
try {
logger.info("Run SQL statement: " + sql);
return statement.executeQuery(sql);
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("sql error!");
}
}
示例12: getClassesByName
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@NotNull
@Override
public PsiClass[] getClassesByName( @NotNull @NonNls String name, @NotNull GlobalSearchScope scope )
{
Set<PsiClass> psiClasses = new HashSet<>();
for( ManModule module: ManTypeFinder.findModules( scope ) )
{
findPsiClasses( name, scope, psiClasses, module );
}
return psiClasses.toArray( new PsiClass[psiClasses.size()] );
}
示例13: getName
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
/**
* Get line marker text. This method should be overridden to generate user-friendly XmlTag presentation.
*/
@Override
@NotNull
@NonNls
public String getName() {
return String.format("%s [%s] - %s", getComponentName(), getAreaName(), getDescription());
}
示例14: textMatches
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@Override
@Contract(
pure = true
)
public boolean textMatches(@NotNull @NonNls CharSequence charSequence) {
return xmlTag.textMatches(charSequence);
}
示例15: selectWithExtraInfo
import org.jetbrains.annotations.NonNls; //导入依赖的package包/类
@NotNull
default ResultSet selectWithExtraInfo(
@NotNull @NonNls String tableName,
@Nullable @NonNls String columnName,
@NotNull @NonNls String extraInfo) {
return querySQL(getQueryString(tableName, columnName) + extraInfo);
}