@Override public boolean apply(String input) { return !Strings.isEmpty(input.trim()); } });
@Override public String toString() { String result = this.getClass().getSimpleName(); return "TerminalConsumer " + (Strings.isEmpty(result) ? this.getClass().getName() : result) + " for rule '" + getRuleName() + "'"; }
public void writeHidden(EObject grammarElement, String value) throws IOException { if (!Strings.isEmpty(value)) { this.appender.append(value); } }
@Override public void write(char[] data, int offset, int count) throws IOException { String message = String.copyValueOf(data, offset, count); if (!Strings.isEmpty(message.trim())) { if (configuration.isVerbose()) LOG.info(message); } }
public static String[] unpack(String packed) { if (isEmpty(packed)) { return null; } else { List<String> strings = Lists.newArrayList(); unpack(strings, packed); return strings.toArray(new String[strings.size()]); } }
public static ModelPath getActiveModelPath() { String modelPathString = System.getProperty(ImportResolver.SYS_VARIABLE_MODEL_PATH); if (Strings.isEmpty(modelPathString)) { return null; } return new ModelPath(modelPathString); }
public void writeSemantic(EObject grammarElement, String value) throws IOException { if (!Strings.isEmpty(value)) { this.appender.append(value); } }
/** Add an implemented type. * @param type the qualified name of the implemented type. */ public void addImplements(String type) { if (!Strings.isEmpty(type)) { this.sarlSkill.getImplements().add(newTypeRef(this.sarlSkill, type)); } }
protected Multimap<String, JvmDeclaredType> getLocallyDefinedTypes(XtextResource resource) { Multimap<String, JvmDeclaredType> result = LinkedHashMultimap.create(); for(JvmDeclaredType type: config.getLocallyDefinedTypes(resource)) { String packageName = type.getPackageName(); if(isEmpty(packageName)) result.put(type.getQualifiedName('.'), type); else result.put(type.getQualifiedName('.').substring(packageName.length() + 1), type); } return result; }
/** Change the return type. @param type the return type of the member. */ public void setReturnType(String type) { if (!Strings.isEmpty(type) && !Objects.equals("void", type) && !Objects.equals(Void.class.getName(), type)) { this.sarlAction.setReturnType(newTypeRef(container, type)); } else { this.sarlAction.setReturnType(null); } }
public static String getNamespace(Grammar g) { if (Strings.isEmpty(g.getName())) return null; String[] splitted = g.getName().split("\\."); return Strings.concat(".", Arrays.asList(splitted), 1); }
/** Initialize the Ecore element when inner type declaration. */ public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) { if (this.sarlInterface == null) { this.container = container; this.sarlInterface = SarlFactory.eINSTANCE.createSarlInterface(); container.getMembers().add(this.sarlInterface); if (!Strings.isEmpty(name)) { this.sarlInterface.setName(name); } } }
/** Initialize the Ecore element when inner type declaration. */ public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) { if (this.sarlClass == null) { this.container = container; this.sarlClass = SarlFactory.eINSTANCE.createSarlClass(); container.getMembers().add(this.sarlClass); if (!Strings.isEmpty(name)) { this.sarlClass.setName(name); } } }
public boolean initialize(EObject targetElement, IRenameElementContext context) { this.nameAttribute = getNameAttribute(targetElement); if(nameAttribute == null) return false; this.targetElementOriginalURI = EcoreUtil.getURI(targetElement); this.originalName = targetElement.eGet(nameAttribute).toString(); return !Strings.isEmpty(originalName); }
protected IProject getBuiltProject(BuildData buildData) { if (Strings.isEmpty(buildData.getProjectName())) return null; return workspace.getRoot().getProject(buildData.getProjectName()); }
@Check public void checkNameIsNotEmpty(Codetemplate template) { if (Strings.isEmpty(template.getName())) { error("Template name cannot be empty.", TemplatesPackage.Literals.CODETEMPLATE__NAME); } }
protected String getLabel (EObject o) { String text = getLabelProvider().getText(o); if(!isEmpty(text)) return HTMLPrinter.convertToHTMLContent(text); else return null; }
@SuppressWarnings("unused") private QualifiedName qualifiedName(ZenModel model) { if (!Strings.isEmpty(model.getNamespace())) { return QualifiedName.create(model.getNamespace().split("\\.")).append(model.getName()); //$NON-NLS-1$ } return QualifiedName.create(model.getName()); } }
protected void startDirectRefactoring() throws InterruptedException { if (Strings.isEmpty(newName)) { restoreOriginalSelection(); } else { String originalName = getOriginalName(getXtextEditor()); if(!equal(originalName, newName)) { IRenameSupport renameSupport = createRenameSupport(renameElementContext, newName); if(renameSupport != null) renameSupport.startDirectRefactoring(); } } }