當前位置: 首頁>>代碼示例>>Java>>正文


Java TextUtils.isEmpty方法代碼示例

本文整理匯總了Java中org.apache.http.util.TextUtils.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java TextUtils.isEmpty方法的具體用法?Java TextUtils.isEmpty怎麽用?Java TextUtils.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.http.util.TextUtils的用法示例。


在下文中一共展示了TextUtils.isEmpty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isTargetTagToCount

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
/**
 * valid tag to count
 */
static boolean isTargetTagToCount(PsiElement tag) {
    if (tag == null || !(tag instanceof XmlTag) || TextUtils.isEmpty(((XmlTag)tag).getName())) {
        return false;
    }
    String name = ((XmlTag)tag).getName();
    return name.equals("array")
            || name.equals("attr")
            || name.equals("bool")
            || name.equals("color")
            || name.equals("declare-styleable")
            || name.equals("dimen")
            || name.equals("drawable")
            || name.equals("eat-comment")
            || name.equals("fraction")
            || name.equals("integer")
            || name.equals("integer-array")
            || name.equals("item")
            || name.equals("plurals")
            || name.equals("string")
            || name.equals("string-array")
            || name.equals("style");
}
 
開發者ID:niorgai,項目名稱:Android-Resource-Usage-Count,代碼行數:26,代碼來源:ResourceUsageCountUtils.java

示例2: generateLombokFieldText

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
private String generateLombokFieldText(ClassEntity classEntity, FieldEntity fieldEntity,String fixme) {
    fixme = fixme == null ? "" : fixme;

    StringBuilder fieldSb = new StringBuilder();
    String filedName = fieldEntity.getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
        fieldSb.append(classEntity.getExtra()).append("\n");
        classEntity.setExtra(null);
    }
    if (fieldEntity.getTargetClass() != null) {
        fieldEntity.getTargetClass().setGenerate(true);
    }

    if (Config.getInstant().isFieldPrivateMode()) {
        fieldSb.append("private  ").append(fieldEntity.getFullNameType()).append(" ").append(filedName).append(" ; ");
    } else {
        fieldSb.append("public  ").append(fieldEntity.getFullNameType()).append(" ").append(filedName).append(" ; ");
    }
    return fieldSb.append(fixme).toString();
}
 
開發者ID:zeng198821,項目名稱:CodeGenerate,代碼行數:21,代碼來源:LombokProcessor.java

示例3: actionPerformed

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    Project project = anActionEvent.getProject();
    if (project != null) {
        String currentApkPath = PropertiesManager.getData(project, PropertyKeys.APK_PATH);

        VirtualFile fileToSelectOnCreate =
                TextUtils.isEmpty(currentApkPath)
                        ? project.getBaseDir()
                        : LocalFileSystem.getInstance().findFileByPath(currentApkPath);

        VirtualFile apkFile = new FileChooserDialogManager.Builder(project, fileToSelectOnCreate)
                .setFileTypes(FileTypes.FILE)
                .setTitle(Strings.TITLE_ASK_APK_FILE)
                .setDescription(Strings.MESSAGE_ASK_APK_FILE)
                .withFileFilter("apk")
                .create()
                .getSelectedFile();

        if (apkFile != null) {
            PropertiesManager.putData(project, PropertyKeys.APK_PATH, apkFile.getPath());
        }
    }
}
 
開發者ID:kaygisiz,項目名稱:Dependency-Injection-Graph,代碼行數:25,代碼來源:SetApkPathAction.java

示例4: generateFieldText

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
private String generateFieldText(ClassEntity classEntity, FieldEntity fieldEntity, String fixme) {
    fixme = fixme == null ? "" : fixme;
    StringBuilder fieldSb = new StringBuilder();
    String fieldName = fieldEntity.getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
        fieldSb.append(classEntity.getExtra()).append("\n");
        classEntity.setExtra(null);
    }
    if (!fieldName.equals(fieldEntity.getKey()) || Config.getInstant().isUseSerializedName()) {
        fieldSb.append(Constant.gsonFullNameAnnotation.replaceAll("\\{filed\\}", fieldEntity.getKey()));
    }
    if (fieldEntity.getTargetClass() != null) {
        fieldEntity.getTargetClass().setGenerate(true);
    }
    return fieldSb.append(String.format("public abstract %s %s(); " + fixme, fieldEntity.getFullNameType(), fieldName)).toString();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:AutoValueProcessor.java

示例5: generateFieldText

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
private String generateFieldText(ClassEntity classEntity, FieldEntity fieldEntity, String fixme) {
    fixme = fixme == null ? "" : fixme;
    StringBuilder fieldSb = new StringBuilder();
    String filedName = fieldEntity.getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
        fieldSb.append(classEntity.getExtra()).append("\n");
        classEntity.setExtra(null);
    }
    if (fieldEntity.getTargetClass() != null) {
        fieldEntity.getTargetClass().setGenerate(true);
    }
    if (!filedName.equals(fieldEntity.getKey()) || Config.getInstant().isUseSerializedName()) {
        fieldSb.append(Config.getInstant().geFullNameAnnotation().replaceAll("\\{filed\\}", fieldEntity.getKey()));
    }

    if (Config.getInstant().isFieldPrivateMode()) {
        fieldSb.append("private  ").append(fieldEntity.getFullNameType()).append(" ").append(filedName).append(" ; ");
    } else {
        fieldSb.append("public  ").append(fieldEntity.getFullNameType()).append(" ").append(filedName).append(" ; ");
    }
    return fieldSb.append(fixme).toString();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:Processor.java

示例6: captureStringLeaveUnderscore

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
/**
 * 轉成駝峰
 *
 * @param text
 * @return
 */
public static String captureStringLeaveUnderscore(String text) {
    if (TextUtils.isEmpty(text)) {
        return text;
    }
    String temp = text.replaceAll("^_+", "");

    if (!TextUtils.isEmpty(temp)) {
        text = temp;
    }
    String[] strings = text.split("_");
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append(strings[0]);
    for (int i = 1; i < strings.length; i++) {
        stringBuilder.append(captureName(strings[i]));
    }
    return stringBuilder.toString();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:24,代碼來源:StringUtils.java

示例7: postNormal

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
private <T> T postNormal(String actionName, Class<T> tClass, Object linkBean) {
    RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(linkBean));
    Request request = new Request.Builder().url(getFullUrl(actionName)).post(body).build();
    T ret = null;
    String result = null;
    try {
        Response response = getOkHttp().newCall(request).execute();
        result = response.body().string();
        if (!TextUtils.isEmpty(result)) {
            //                if (result.contains("error_code")) {
            //                    mLogger.error("postForm result error ,actionName = " + actionName + " ,detail : " + result);
            //                } else {
            ret = gson.fromJson(result, tClass);
            //                }
        }
        System.out.println("post成功 result = " + result);
    } catch (Exception e) {
        mLogger.error("postForm IOException1 action: " + actionName + " ," + tClass.getName() + " ,detail: " + e.getMessage() + ",resultStr = " + result);
        e.printStackTrace();
    }
    return ret;
}
 
開發者ID:lucid-lynxz,項目名稱:Webhook_server,代碼行數:23,代碼來源:HttpUtil.java

示例8: getFullUrl

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
/**
 * 生成get方法完整url地址:  https://www.okcoin.com/api/v1/future_index.do?symbol=btc_usd
 *
 * @param actionName 請求動作名稱:future_index.do
 * @param contents   查詢參數:  symbol,btc_usd
 */
private String getFullUrl(String actionName, String... contents) {
    if (TextUtils.isEmpty(Params.accessToken)) {
        System.out.println("access_token非法 " + Params.accessToken);
    }
    // 這個是釘釘要加的,都統一加上吧,暫時沒發現問題,就不做特殊處理了
    String result = "?access_token=" + Params.accessToken + "&";
    if (contents != null && contents.length > 0 && contents.length % 2 == 0) {
        for (int i = 0; i < contents.length - 1; i += 2) {
            result += contents[i] + "=" + contents[i + 1] + "&";
        }
    }
    if (!TextUtils.isEmpty(result)) {
        result = result.substring(0, result.length() - 1);
    }
    return Params.getDingTalkServerUrl() + actionName + result;
}
 
開發者ID:lucid-lynxz,項目名稱:Webhook_server,代碼行數:23,代碼來源:HttpUtil.java

示例9: setValueAt

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
@Override
public void setValueAt(int column, String text) {
    switch (column) {
        case 2:
            break;
        case 3:
            String result;
            if (!TextUtils.isEmpty(fieldTypeSuffix)) {
                result = fieldTypeSuffix + "." + text;
            } else {
                result = text;
            }
            if (CheckUtil.getInstant().containsDeclareClassName(result)) {
                return;
            }
            CheckUtil.getInstant().removeDeclareClassName(getQualifiedName());
            setClassName(text);
            break;
    }
}
 
開發者ID:zeng198821,項目名稱:CodeGenerate,代碼行數:21,代碼來源:ClassEntity.java

示例10: apply

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
@Override
public void apply() throws ConfigurationException {
    try {
        PropertiesComponent.getInstance().setValue(KEY_RULES_PATH, rulesPath.getText());
        if (!TextUtils.isEmpty(rulesPath.getText())) {
            load(rulesPath.getText());
            DirectiveLint.prepare();
        } else {
            DirectiveLint.reset();
        }
    } catch (Exception e) {
        ProjectUtil.guessCurrentProject(select).getMessageBus().syncPublisher(Notifications.TOPIC).notify(
                new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID,
                        "Weex language support - bad rules",
                        e.toString(),
                        NotificationType.ERROR));
    }
    savePaths();
}
 
開發者ID:misakuo,項目名稱:weex-language-support,代碼行數:20,代碼來源:Settings.java

示例11: queryWxUserNick

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
public String queryWxUserNick(String openId) throws IOException {
    String nick = userNickMap.get(openId);
    if (TextUtils.isEmpty(nick)) {
        String url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=%s&openid=%s&lang=zh_CN";
        url = String.format(url, wxAuthService.queryAccessToken(), openId);

        String res = HttpClientPool.getInstance().get(url);
        if (TextUtils.isEmpty(res)) {
            return null;
        } else {
            JSONObject json = JSONObject.parseObject(res);
            nick = json.getString("nickname");
            userNickMap.put(openId, nick);
            // 更新到七魚
            updateWxUserToQiyu(openId, json);
        }
    }
    return nick;
}
 
開發者ID:qiyu-kefu,項目名稱:message_interface,代碼行數:20,代碼來源:WXUserService.java

示例12: match

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
public boolean match(String value) {
    if (TextUtils.isEmpty(valuePattern)) {
        return false;
    }
    if (valuePattern.toLowerCase().equals("mustache")) {
        return Pattern.compile("\\{\\{.*\\}\\}").matcher(value).matches();
    }  else if (valuePattern.toLowerCase().equals("number")) {
        return Pattern.compile("[0-9]+([.][0-9]+)?$").matcher(value).matches();
    } else if (valuePattern.toLowerCase().equals("boolean")) {
        return Pattern.compile("(true|false)$").matcher(value).matches();
    }  else {
        try {
            return Pattern.compile(valuePattern).matcher(value).matches();
        } catch (Exception e) {
            return false;
        }
    }
}
 
開發者ID:misakuo,項目名稱:weex-language-support,代碼行數:19,代碼來源:Attribute.java

示例13: onClick

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    switch (v.getId()){

        case R.id.btnregister:
            username = edtname.getText().toString();
            password = edtpass.getText().toString();
            email    = edtmail.getText().toString();
            if (TextUtils.isEmpty(username)){

                edtname.setError(username);
            } else if(TextUtils.isEmpty(password)){
                edtpass.setError("Enter Password");
            }else if(TextUtils.isEmpty(email)){
                edtmail.setError("Enter Password");
            }
            else
            SendRegRequest();
    }
}
 
開發者ID:Weavebytesipl,項目名稱:FutureErpAndroid,代碼行數:21,代碼來源:RegistrationActivity.java

示例14: onClick

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    switch (v.getId()) {

        case R.id.btnlogin:
            username = name.getText().toString();
            password = pass.getText().toString();
            if(TextUtils.isEmpty(username))
            {
                name.setError("Enter Name");
            }
        else if(TextUtils.isEmpty(password)){
            pass.setError("Enter Password");
           }
            else {
                SendJsonRequest();
            }
            break;
        case R.id.btnregister:
            Intent it = new Intent(LoginActivity.this,RegistrationActivity.class);
            startActivity(it);
            break;

    }
}
 
開發者ID:Weavebytesipl,項目名稱:FutureErpAndroid,代碼行數:26,代碼來源:LoginActivity.java

示例15: getBotToken

import org.apache.http.util.TextUtils; //導入方法依賴的package包/類
@Override
public String getBotToken() {

    if (TextUtils.isEmpty(token)) {
        final Properties properties = new Properties();

        try {
            properties.load(properties.getClass().getResourceAsStream("/secret.properties"));
        } catch (IOException e) {
            throw new RuntimeException("No secret.properties with telegram token found in resources/");
        }

        token = properties.getProperty("token");

        if (TextUtils.isEmpty(token)) {
            throw new RuntimeException("No telegram token found in resources/secret.properties");
        }

        return token;
    }
    return token;
}
 
開發者ID:SammyVimes,項目名稱:gopstopbot,代碼行數:23,代碼來源:TGBot.java


注:本文中的org.apache.http.util.TextUtils.isEmpty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。