public static String xmlNameForItem(BindProperty property) { String namespace=property.xmlInfo.namespace; String label=property.xmlInfo.labelItem; if (StringUtils.hasText(namespace)) { return namespace+":"+label; } return label; }
/** * Check size. * * @param value the value * @param limitSize the limit size * @return the string */ public static String checkSize(byte[] value, int limitSize) { if (value != null) { if (value.length > limitSize) { return bytesToHex(value, limitSize-3) + "..."; } else return bytesToHex(value, value.length); } else return null; }
if (StringUtils.hasText(where)) jql.annotatedWhere = true; if (StringUtils.hasText(where) || method.hasDynamicWhereConditions()) { builder.append(" " + WHERE_KEYWORD); if (StringUtils.hasText(where)) { jql.staticWhereConditions = true; builder.append(StringUtils.startWithSpace(where)); if (StringUtils.hasText(method.dynamicWhereParameterName)) { StringBuilder dynamicBuffer = new StringBuilder(); dynamicBuffer.append(" #{" + JQLDynamicStatementType.DYNAMIC_WHERE + "}");
/** * Drop all table with specific prefix. * * @param db * the db * @param prefix * the prefix */ public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) { Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX ")); drop(db, QueryType.TABLE, prefix); }
/** * limit string size to 32. * * @param value the value * @return the string */ public static String checkSize(byte[] value) { return checkSize(value, 32); }
String msg = StringUtils.nvl(e.getMessage()); error(null, e.getClass().getCanonicalName() + ": " + msg);
currentDaoDefinition.contentProviderTypeName = daoContentProviderPath.typeName(); if (StringUtils.isEmpty(currentDaoDefinition.contentProviderTypeName)) { Converter<String, String> convert = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_UNDERSCORE); AssertKripton.assertTrue(currentDaoDefinition.getParent().contentProvider != null,
if (StringUtils.hasText(orderBy)) { result.annotatedOrderBy = true; if (StringUtils.hasText(orderBy) || StringUtils.hasText(orderDynamicName.value0)) { builder.append(" " + ORDER_BY_KEYWORD); if (StringUtils.hasText(orderBy)) { result.staticOrderBy = true; builder.append(StringUtils.startWithSpace(orderBy)); if (StringUtils.hasText(orderDynamicName.value0)) { if (StringUtils.hasText(orderBy)) { dynamicBuffer.append(","); builder.append(",");
/** * Drop all table with specific prefix. * * @param db * the db * @param prefix * the prefix */ public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) { Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX ")); drop(db, QueryType.TABLE, prefix); }
/** * limit string size to 32. * * @param value the value * @return the string */ public static String checkSize(Object value) { return checkSize(value, VIEW_SIZE, null); }
/** * Gets the qualified name. * * @return the qualified name */ public String getQualifiedName() { if (StringUtils.hasText(packageName)) { return packageName+"."+name; } return name; }
/** * Drop all table with specific prefix. * * @param db * the db * @param prefix * the prefix */ public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) { Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX ")); drop(db, QueryType.TABLE, prefix); }
/** * limit string size to 32. * * @param value the value * @return the string */ public static String checkSize(Object value) { return checkSize(value, VIEW_SIZE, null); }
/** * Check size. * * @param value the value * @param limitSize the limit size * @return the string */ public static String checkSize(byte[] value, int limitSize) { if (value != null) { if (value.length > limitSize) { return bytesToHex(value, limitSize-3) + "..."; } else return bytesToHex(value, value.length); } else return null; }
/** * Gets the qualified name. * * @return the qualified name */ public String getQualifiedName() { if (StringUtils.hasText(packageName)) { return packageName + "." + typeSpec.name; } return typeSpec.name; }
/** * Extract where conditions. * * @param updateMode * the update mode * @param method * the method * @return the string */ static String extractWhereConditions(boolean updateMode, SQLiteModelMethod method) { final One<String> whereCondition = new One<String>(""); final One<Boolean> found = new One<Boolean>(null); JQLChecker.getInstance().replaceVariableStatements(method, method.jql.value, new JQLReplaceVariableStatementListenerImpl() { @Override public String onWhere(String statement) { if (found.value0 == null) { whereCondition.value0 = statement; found.value0 = true; } return null; } }); return StringUtils.ifNotEmptyAppend(whereCondition.value0, " "); }
/** * limit string size to 32. * * @param value the value * @param defaultValue the default value * @return the string */ public static String checkSize(Object value, String defaultValue) { return checkSize(value, VIEW_SIZE, defaultValue); }