List of usage examples for org.apache.commons.lang3 StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang3 StringUtils EMPTY.
Click Source Link
From source file:de.jcup.egradle.codeassist.RelevantCodeCutter.java
private String getLeftText(String code, int offset) { char[] chars = code.toCharArray(); int start = offset - 1; if (start < 0) { return StringUtils.EMPTY; }/* w ww . j a va 2s . c om*/ StringBuilder sb = new StringBuilder(); for (int i = start; i >= 0; i--) { char c = chars[i]; if (isDelimiter(c)) { break; } sb.append(c); } String result = StringUtils.reverse(sb.toString()); return result; }
From source file:ch.cyberduck.ui.cocoa.controller.DuplicateFileController.java
@Override public NSView getAccessoryView(final NSAlert alert) { final NSView view = super.getAccessoryView(alert); String proposal = MessageFormat.format(PreferencesFactory.get().getProperty("browser.duplicate.format"), FilenameUtils.getBaseName(selected.getName()), UserDateFormatterFactory.get().getShortFormat(System.currentTimeMillis(), false) .replace(Path.DELIMITER, ':'), StringUtils.isNotBlank(selected.getExtension()) ? String.format(".%s", selected.getExtension()) : StringUtils.EMPTY); this.updateField(inputField, proposal); return view;//from ww w . ja va2 s . c om }
From source file:de.rkl.tools.tzconv.configuration.PreferencesProvider.java
private void dumpTemplateFilePathIntoPreferences() { final File templateFile = applicationModel.templateFile.getValue(); applicationPreferences.put(PREFERENCES_KEY_TEMPLATE_FILE_PATH, templateFile == null ? StringUtils.EMPTY : templateFile.getAbsolutePath()); }
From source file:net.roboconf.dm.templating.internal.helpers.AllHelper.java
/** * Selects instances according to a selection path. * <p>For example:</p>/*from w w w .j a va 2 s . co m*/ * <pre> * {{#all children path="/VM/Apache" installer="script"}} * {{path}} * {{/all}} * </pre> */ @Override public CharSequence apply(final Object computedContext, final Options options) throws IOException { // Get parameters Object context = options.context.model(); String componentPath = null; if (computedContext instanceof String) componentPath = (String) computedContext; if (Utils.isEmptyOrWhitespaces(componentPath)) componentPath = InstanceFilter.JOKER; // Process them CharSequence result = StringUtils.EMPTY; if (context instanceof ApplicationContextBean) { // Implicit: all instances of the application. result = safeApply(((ApplicationContextBean) context).getInstances(), options, componentPath); } else if (context instanceof InstanceContextBean) { // Implicit: all descendants of the instance. result = safeApply(descendantInstances((InstanceContextBean) context), options, componentPath); } else { this.logger.warning( "An unexpected context was received: " + (context == null ? null : context.getClass())); } return result; }
From source file:edu.hm.hafner.analysis.parser.CadenceIncisiveParser.java
@Override protected Optional<Issue> createIssue(final Matcher matcher, final IssueBuilder builder) { String tool;// w ww. j a v a 2s . c o m String type; String category; String message; String fileName; int lineNumber = 0; Severity priority; if (matcher.group(1) != null) { /* vhdl warning from ncelab */ tool = matcher.group(2); type = matcher.group(3); category = matcher.group(4); fileName = matcher.group(6); lineNumber = parseInt(matcher.group(7)); message = matcher.group(5); priority = Severity.WARNING_NORMAL; } else if (matcher.group(16) != null) { return Optional.empty(); } else if (matcher.group(8) != null) { tool = matcher.group(9); type = matcher.group(10); category = matcher.group(11); fileName = matcher.group(12); lineNumber = parseInt(matcher.group(13)); message = matcher.group(15); priority = Severity.WARNING_NORMAL; } else if (matcher.group(21) != null) { tool = matcher.group(22); type = matcher.group(23); category = matcher.group(24); fileName = StringUtils.EMPTY; message = matcher.group(25); priority = Severity.WARNING_LOW; } else { return Optional.empty(); /* Should never happen! */ } if ("E".equalsIgnoreCase(type)) { priority = Severity.WARNING_HIGH; category = "Error (" + tool + "): " + category; } else { category = "Warning (" + tool + "): " + category; } // Filename should never be null here, unless someone updates from the code above fail if (fileName == null) { return Optional.empty(); } if (fileName.startsWith(SLASH)) { return builder.setFileName(fileName).setLineStart(lineNumber).setCategory(category).setMessage(message) .setSeverity(priority).buildOptional(); } return builder.setFileName(fileName).setLineStart(lineNumber).setCategory(category).setMessage(message) .setSeverity(priority).buildOptional(); }
From source file:com.nridge.connector.common.con_com.crawl.CrawlQueue.java
/** * Constructor accepts an application manager parameter and initializes * the object accordingly.//w ww .j av a2s. c o m * * @param anAppMgr Application manager. */ public CrawlQueue(final AppMgr anAppMgr) { mAppMgr = anAppMgr; mCrawlType = StringUtils.EMPTY; mPhaseComplete = new HashMap<String, AtomicBoolean>(); mPhaseComplete.put(Connector.PHASE_EXTRACT, new AtomicBoolean(false)); mPhaseComplete.put(Connector.PHASE_TRANSFORM, new AtomicBoolean(false)); mPhaseComplete.put(Connector.PHASE_PUBLISH, new AtomicBoolean(false)); mCrawlLastModified = DateUtils.addYears(new Date(), CRAWL_BEGINNING_OF_TIME); }
From source file:com.nridge.core.base.std.DigitalHash.java
/** * Converts the message digest byte sequence values into a hexadecimal * string representation.//from w ww .j av a2 s . c o m * * @return A hexadecimal string. */ public String getHashSequence() { byte[] digestBytes; StringBuilder hexStrBuilder; if (mMsgDigest == null) return StringUtils.EMPTY; else { digestBytes = mMsgDigest.digest(); hexStrBuilder = new StringBuilder(); for (byte digestByte : digestBytes) { if ((digestByte >= 0) && (digestByte < 16)) hexStrBuilder.append("0"); hexStrBuilder.append(Integer.toHexString(0xFF & digestByte)); } return hexStrBuilder.toString(); } }
From source file:com.linq.cache.serializer.JacksonJsonRedisSerializer.java
public String serialize(Object t) throws SerializationException { if (t == null) { return StringUtils.EMPTY; }//from ww w . j av a 2s . c o m try { return this.objectMapper.writeValueAsString(t); } catch (Exception ex) { throw new SerializationException("Could not write JSON: " + ex.getMessage(), ex); } }
From source file:com.quatico.base.aem.test.api.setup.Tags.java
@Override public String renderTag(TagSupport tag) throws Exception { return renderTag(tag, StringUtils.EMPTY); }
From source file:monasca.log.api.model.Log.java
@Transient public String getMessage() { final String val = (String) this.get(KEY_MESSAGE); return val != null ? val : StringUtils.EMPTY; }