本文整理匯總了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);
}