Java 类org.eclipse.xtext.xbase.lib.StringExtensions 实例源码

项目:maker    文件:Ddl2Bean.java   
public static List<Ddl2Bean.Klass> map(final Table table) {
  Column[] _columns = table.getColumns();
  final Function1<Column, Ddl2Bean.Klass> _function = (Column column) -> {
    Ddl2Bean.Klass _xblockexpression = null;
    {
      String _type = column.getType();
      String type = Ddl2Bean.fieldType(_type);
      String columnName = column.getName();
      String _name = column.getName();
      String[] _split = _name.split("_");
      final Function1<String, String> _function_1 = (String it) -> {
        return StringExtensions.toFirstUpper(it);
      };
      List<String> _map = ListExtensions.<String, String>map(((List<String>)Conversions.doWrapArray(_split)), _function_1);
      String _join = IterableExtensions.join(_map);
      String name = StringExtensions.toFirstLower(_join);
      String comment = column.getDescription();
      _xblockexpression = new Ddl2Bean.Klass(type, name, columnName, comment);
    }
    return _xblockexpression;
  };
  return ListExtensions.<Column, Ddl2Bean.Klass>map(((List<Column>)Conversions.doWrapArray(_columns)), _function);
}
项目:xtext-extras    文件:ImplicitlyImportedFeatures.java   
protected List<Class<?>> getExtensionClasses() {
    return Lists.<Class<?>> newArrayList(
        ArrayExtensions.class,
        BigDecimalExtensions.class,
        BigIntegerExtensions.class,
        BooleanExtensions.class,
        ByteExtensions.class,
        CharacterExtensions.class,
        CollectionExtensions.class,
        ComparableExtensions.class,
        DoubleExtensions.class,
        FloatExtensions.class,
        FunctionExtensions.class,
        IntegerExtensions.class,
        IterableExtensions.class,
        IteratorExtensions.class,
        ListExtensions.class,
        LongExtensions.class,
        MapExtensions.class,
        ObjectExtensions.class,
        ProcedureExtensions.class,
        ShortExtensions.class,
        StringExtensions.class);
}
项目:xtext-extras    文件:JvmModelGenerator.java   
public void generateJavaDoc(final EObject it, final ITreeAppendable appendable, final GeneratorConfig config) {
  final DocumentationAdapter adapter = IterableExtensions.<DocumentationAdapter>head(Iterables.<DocumentationAdapter>filter(it.eAdapters(), DocumentationAdapter.class));
  String _documentation = null;
  if (adapter!=null) {
    _documentation=adapter.getDocumentation();
  }
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_documentation);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    final Set<EObject> sourceElements = this.getSourceElements(it);
    if (((sourceElements.size() == 1) && (this.documentationProvider instanceof IEObjectDocumentationProviderExtension))) {
      final List<INode> documentationNodes = ((IEObjectDocumentationProviderExtension) this.documentationProvider).getDocumentationNodes(IterableExtensions.<EObject>head(sourceElements));
      this.addJavaDocImports(it, appendable, documentationNodes);
      this.generateDocumentation(adapter.getDocumentation(), documentationNodes, appendable, config);
    } else {
      this.generateDocumentation(adapter.getDocumentation(), CollectionLiterals.<INode>emptyList(), appendable, config);
    }
  }
}
项目:xtext-extras    文件:TestsEMFGeneratorFragment.java   
@Override
protected String getEcoreFilePath(final Grammar grammar) {
  String _xifexpression = null;
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(this.ecoreModel);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    _xifexpression = this.ecoreModel;
  } else {
    String _javaModelDirectory = this.getJavaModelDirectory();
    String _plus = (_javaModelDirectory + "/");
    String _replace = grammar.getName().substring(0, grammar.getName().lastIndexOf(".")).replace(".", "/");
    String _plus_1 = (_plus + _replace);
    String _plus_2 = (_plus_1 + "/");
    String _modelName = this.getModelName(grammar);
    String _plus_3 = (_plus_2 + _modelName);
    _xifexpression = (_plus_3 + ".ecore");
  }
  return _xifexpression;
}
项目:xtext-extras    文件:TestsEMFGeneratorFragment.java   
@Override
protected String getGenModelPath(final Grammar grammar) {
  String _xifexpression = null;
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(this.genModel);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    _xifexpression = this.genModel;
  } else {
    String _javaModelDirectory = this.getJavaModelDirectory();
    String _plus = (_javaModelDirectory + "/");
    String _replace = grammar.getName().substring(0, grammar.getName().lastIndexOf(".")).replace(".", "/");
    String _plus_1 = (_plus + _replace);
    String _plus_2 = (_plus_1 + "/");
    String _modelName = this.getModelName(grammar);
    String _plus_3 = (_plus_2 + _modelName);
    _xifexpression = (_plus_3 + ".genmodel");
  }
  return _xifexpression;
}
项目:xtext-lib    文件:PropertyProcessor.java   
@Override
public void doTransform(final MutableFieldDeclaration it, @Extension final TransformationContext context) {
  @Extension
  final AccessorsProcessor.Util util = new AccessorsProcessor.Util(context);
  boolean _hasGetter = util.hasGetter(it);
  boolean _not = (!_hasGetter);
  if (_not) {
    util.addGetter(it, Visibility.PUBLIC);
  }
  if (((!it.isFinal()) && (!util.hasSetter(it)))) {
    util.addSetter(it, Visibility.PUBLIC);
  }
  String _firstLower = StringExtensions.toFirstLower(it.getSimpleName());
  String _plus = ("_" + _firstLower);
  it.setSimpleName(_plus);
}
项目:xtext-lib    文件:AccessorsProcessor.java   
public List<String> getPossibleGetterNames(final FieldDeclaration it) {
  final ArrayList<String> names = CollectionLiterals.<String>newArrayList();
  if ((((this.isBooleanType(this.orObject(it.getType())) && it.getSimpleName().startsWith("is")) && (it.getSimpleName().length() > 2)) && Character.isUpperCase(it.getSimpleName().charAt(2)))) {
    String _simpleName = it.getSimpleName();
    names.add(_simpleName);
  }
  List<String> _xifexpression = null;
  boolean _isBooleanType = this.isBooleanType(this.orObject(it.getType()));
  if (_isBooleanType) {
    _xifexpression = Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("is", "get"));
  } else {
    _xifexpression = Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("get"));
  }
  final Function1<String, String> _function = new Function1<String, String>() {
    @Override
    public String apply(final String prefix) {
      String _firstUpper = StringExtensions.toFirstUpper(it.getSimpleName());
      return (prefix + _firstUpper);
    }
  };
  names.addAll(ListExtensions.<String, String>map(_xifexpression, _function));
  return names;
}
项目:xtext-core    文件:TracedAccessorsProcessor.java   
public String featureName(final ResolvedMethod m) {
  String _xblockexpression = null;
  {
    final String n = m.getDeclaration().getSimpleName();
    int _xifexpression = (int) 0;
    boolean _startsWith = n.startsWith("get");
    if (_startsWith) {
      _xifexpression = 3;
    } else {
      _xifexpression = 2;
    }
    final int skip = _xifexpression;
    _xblockexpression = StringExtensions.toFirstLower(m.getDeclaration().getSimpleName().substring(skip));
  }
  return _xblockexpression;
}
项目:xtext-core    文件:Formatter2Fragment2.java   
protected String toVarName(final ENamedElement element, final String... reservedNames) {
  String _xblockexpression = null;
  {
    if ((element instanceof EReference)) {
      return this.toVarName(((EReference)element).getEReferenceType(), reservedNames);
    }
    String name = StringExtensions.toFirstLower(element.getName());
    boolean _contains = XtendFileAccess.XTEND_KEYWORDS.contains(name);
    if (_contains) {
      name = ("_" + name);
    }
    boolean _contains_1 = ((List<String>)Conversions.doWrapArray(reservedNames)).contains(name);
    if (_contains_1) {
      name = ("_" + name);
    }
    _xblockexpression = name;
  }
  return _xblockexpression;
}
项目:xtext-core    文件:TestsEMFGeneratorFragment.java   
@Override
protected String getEcoreFilePath(final Grammar grammar) {
  String _xifexpression = null;
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(this.ecoreModel);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    _xifexpression = this.ecoreModel;
  } else {
    String _javaModelDirectory = this.getJavaModelDirectory();
    String _plus = (_javaModelDirectory + "/");
    String _replace = grammar.getName().substring(0, grammar.getName().lastIndexOf(".")).replace(".", "/");
    String _plus_1 = (_plus + _replace);
    String _plus_2 = (_plus_1 + "/");
    String _modelName = this.getModelName(grammar);
    String _plus_3 = (_plus_2 + _modelName);
    _xifexpression = (_plus_3 + ".ecore");
  }
  return _xifexpression;
}
项目:xtext-core    文件:TestsEMFGeneratorFragment.java   
@Override
protected String getGenModelPath(final Grammar grammar) {
  String _xifexpression = null;
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(this.genModel);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    _xifexpression = this.genModel;
  } else {
    String _javaModelDirectory = this.getJavaModelDirectory();
    String _plus = (_javaModelDirectory + "/");
    String _replace = grammar.getName().substring(0, grammar.getName().lastIndexOf(".")).replace(".", "/");
    String _plus_1 = (_plus + _replace);
    String _plus_2 = (_plus_1 + "/");
    String _modelName = this.getModelName(grammar);
    String _plus_3 = (_plus_2 + _modelName);
    _xifexpression = (_plus_3 + ".genmodel");
  }
  return _xifexpression;
}
项目:xtext-gef    文件:StateConstraint.java   
@Override
public IStatus validate(final IValidationContext ctx) {
  IStatus _xifexpression = null;
  EObject _target = ctx.getTarget();
  if ((_target instanceof State)) {
    IStatus _xblockexpression = null;
    {
      EObject _target_1 = ctx.getTarget();
      final State state = ((State) _target_1);
      IStatus _xifexpression_1 = null;
      String _name = state.getName();
      boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_name);
      if (_isNullOrEmpty) {
        _xifexpression_1 = ctx.createFailureStatus();
      }
      _xblockexpression = _xifexpression_1;
    }
    _xifexpression = _xblockexpression;
  }
  return _xifexpression;
}
项目:statecharts    文件:CDefaultFeatureValueProvider.java   
@Override
protected void setDefaultValue(FeatureType featureType, FeatureParameterValue parameterValue,
        EObject contextElement) {

    GeneratorEntry entry = (GeneratorEntry) contextElement;
    Statechart statechart = (Statechart) entry.getElementRef();
    String parameterName = parameterValue.getParameter().getName();

    if (ICFeatureConstants.PARAMETER_NAMING_MODULE_NAME.equals(parameterName)) {
        parameterValue.setValue(asIdentifier(statechart.getName(), "_"));
    } else if (ICFeatureConstants.PARAMETER_NAMING_STATEMACHINE_PREFIX.equals(parameterName)) {
        parameterValue.setValue(StringExtensions.toFirstLower(asIdentifier(statechart.getName(), "_")));
    } else if (ICFeatureConstants.PARAMETER_NAMING_MAX_IDENTIFIER_LENGTH.equals(parameterName)) {
        parameterValue.setValue(31);
    } else if (ICFeatureConstants.PARAMETER_NAMING_SEPARATOR.equals(parameterName)) {
        parameterValue.setValue("_");
    } else if (ICFeatureConstants.PARAMETER_TRACING_ENTER_STATE.equals(parameterName)) {
        parameterValue.setValue(true);
    } else if (ICFeatureConstants.PARAMETER_TRACING_EXIT_STATE.equals(parameterName)) {
        parameterValue.setValue(true);
    } else if (ICFeatureConstants.PARAMETER_INCLUDES_USE_RELATIVE_PATHS.equals(parameterName)) {
        parameterValue.setValue(true);
    } else {
        throw new IllegalArgumentException("Unsupported parameter '" + parameterName + "'.");
    }
}
项目:maker    文件:Names.java   
public static String webFullName(final String firstName, final String href) {
  String _xblockexpression = null;
  {
    Jerry _parts = TungParser.parts(href, ".listbox1 .listbox1_text");
    String _text = _parts.text();
    String[] _split = _text.split(firstName);
    final Function1<String, Boolean> _function = (String it) -> {
      boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(it);
      return Boolean.valueOf((!_isNullOrEmpty));
    };
    Iterable<String> _filter = IterableExtensions.<String>filter(((Iterable<String>)Conversions.doWrapArray(_split)), _function);
    final List<String> lastNames = IterableExtensions.<String>toList(_filter);
    double _random = Math.random();
    int _size = lastNames.size();
    double _multiply = (_random * _size);
    final int lastNameIndex = ((int) _multiply);
    final String lastName = lastNames.get(lastNameIndex);
    _xblockexpression = (firstName + lastName);
  }
  return _xblockexpression;
}
项目:maker    文件:Words.java   
public static List<String> list(final String words) {
  List<String> _xblockexpression = null;
  {
    String newWords = words;
    int _countIn = CharMatcher.JAVA_UPPER_CASE.countIn(words);
    boolean _greaterThan = (_countIn > 0);
    if (_greaterThan) {
      String _firstUpper = StringExtensions.toFirstUpper(words);
      String _to = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, _firstUpper);
      newWords = _to;
    }
    boolean _contains = newWords.contains("-");
    if (_contains) {
      newWords.replace("-", "_");
    }
    String[] _split = newWords.split("_");
    _xblockexpression = IterableExtensions.<String>toList(((Iterable<String>)Conversions.doWrapArray(_split)));
  }
  return _xblockexpression;
}
项目:maker    文件:PoiBlock.java   
public String fkClazzIdName() {
  boolean _contains = this.keyInfo.contains("F-");
  boolean _not = (!_contains);
  if (_not) {
    return "";
  }
  if ((this.keyInfo.contains("F-J") || this.keyInfo.contains("F-M"))) {
    return "";
  }
  String _fkClazzType = this.fkClazzType();
  String _firstLower = StringExtensions.toFirstLower(_fkClazzType);
  Module _moduleByClass = Modules.moduleByClass(_firstLower);
  final List<Block> blocks = _moduleByClass.getBlocks();
  final Function1<Block, Boolean> _function = (Block it) -> {
    String _keyInfo = it.getKeyInfo();
    return Boolean.valueOf(_keyInfo.startsWith("P"));
  };
  Block _findFirst = IterableExtensions.<Block>findFirst(blocks, _function);
  String _fieldName = null;
  if (_findFirst!=null) {
    _fieldName=_findFirst.getFieldName();
  }
  final String result = _fieldName;
  return result;
}
项目:maker    文件:PoiBlock.java   
public String fkClazzShowName() {
  boolean _contains = this.keyInfo.contains("F-");
  boolean _not = (!_contains);
  if (_not) {
    return "";
  }
  if ((this.keyInfo.contains("F-J") || this.keyInfo.contains("F-M"))) {
    return "";
  }
  String _fkClazzType = this.fkClazzType();
  String _firstLower = StringExtensions.toFirstLower(_fkClazzType);
  Module _moduleByClass = Modules.moduleByClass(_firstLower);
  List<Block> _blocks = _moduleByClass.getBlocks();
  final Function1<Block, Boolean> _function = (Block it) -> {
    return Boolean.valueOf(((Objects.equal(it.getFieldName(), "name") || Objects.equal(it.getFieldName(), "realname")) || Objects.equal(it.getFieldName(), "nickname")));
  };
  Block _findFirst = IterableExtensions.<Block>findFirst(_blocks, _function);
  return _findFirst.getFieldName();
}
项目:maker    文件:Ddl2Bean.java   
public static String klassType(final Table table) {
  String _xblockexpression = null;
  {
    String _name = table.getName();
    String _substring = _name.substring(2);
    String[] _split = _substring.split("_");
    final Function1<String, String> _function = (String it) -> {
      return StringExtensions.toFirstUpper(it);
    };
    List<String> _map = ListExtensions.<String, String>map(((List<String>)Conversions.doWrapArray(_split)), _function);
    String name = IterableExtensions.join(_map);
    boolean _equals = Objects.equal(name, "Enum");
    if (_equals) {
      name = "EnumCode";
    }
    _xblockexpression = name;
  }
  return _xblockexpression;
}
项目:maker    文件:Ddl2Rest.java   
public static List<Ddl2Rest.Klass> map(final Table table) {
  Column[] _columns = table.getColumns();
  final Function1<Column, Ddl2Rest.Klass> _function = (Column column) -> {
    Ddl2Rest.Klass _xblockexpression = null;
    {
      String _type = column.getType();
      String type = Ddl2Rest.fieldType(_type);
      String columnName = column.getName();
      String _name = column.getName();
      String[] _split = _name.split("_");
      final Function1<String, String> _function_1 = (String it) -> {
        return StringExtensions.toFirstUpper(it);
      };
      List<String> _map = ListExtensions.<String, String>map(((List<String>)Conversions.doWrapArray(_split)), _function_1);
      String _join = IterableExtensions.join(_map);
      String name = StringExtensions.toFirstLower(_join);
      String comment = column.getDescription();
      _xblockexpression = new Ddl2Rest.Klass(type, name, columnName, comment);
    }
    return _xblockexpression;
  };
  return ListExtensions.<Column, Ddl2Rest.Klass>map(((List<Column>)Conversions.doWrapArray(_columns)), _function);
}
项目:maker    文件:GettersCompilationParticipant.java   
@Override
public void doTransform(final MutableClassDeclaration clazz, @Extension final TransformationContext ctx) {
  final Iterable<? extends MutableFieldDeclaration> fields = clazz.getDeclaredFields();
  final Consumer<MutableFieldDeclaration> _function = (MutableFieldDeclaration field) -> {
    MutableTypeDeclaration _declaringType = field.getDeclaringType();
    String _simpleName = field.getSimpleName();
    String _firstUpper = StringExtensions.toFirstUpper(_simpleName);
    String _plus = ("get" + _firstUpper);
    final Procedure1<MutableMethodDeclaration> _function_1 = (MutableMethodDeclaration it) -> {
      TypeReference _type = field.getType();
      it.setReturnType(_type);
      final CompilationStrategy _function_2 = (CompilationStrategy.CompilationContext it_1) -> {
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("return this.");
        String _simpleName_1 = field.getSimpleName();
        _builder.append(_simpleName_1, "");
        _builder.append(";");
        _builder.newLineIfNotEmpty();
        return _builder;
      };
      it.setBody(_function_2);
    };
    _declaringType.addMethod(_plus, _function_1);
  };
  fields.forEach(_function);
}
项目:maker    文件:GetterCompilationParticipant.java   
@Override
public void doTransform(final MutableFieldDeclaration field, @Extension final TransformationContext ctx) {
  MutableTypeDeclaration _declaringType = field.getDeclaringType();
  String _simpleName = field.getSimpleName();
  String _firstUpper = StringExtensions.toFirstUpper(_simpleName);
  String _plus = ("get" + _firstUpper);
  final Procedure1<MutableMethodDeclaration> _function = (MutableMethodDeclaration it) -> {
    TypeReference _type = field.getType();
    it.setReturnType(_type);
    final CompilationStrategy _function_1 = (CompilationStrategy.CompilationContext it_1) -> {
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("return this.");
      String _simpleName_1 = field.getSimpleName();
      _builder.append(_simpleName_1, "");
      _builder.append(";");
      _builder.newLineIfNotEmpty();
      return _builder;
    };
    it.setBody(_function_1);
  };
  _declaringType.addMethod(_plus, _function);
}
项目:abattle    文件:LANGameStartup.java   
public void join() throws BaseException {
  ComponentLookup _instance = ComponentLookup.getInstance();
  ConfigurationComponent _component = _instance.<ConfigurationComponent>getComponent(ConfigurationComponent.class);
  GlobalOptionsData _globalOptions = _component.getGlobalOptions();
  String name = _globalOptions.getName();
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(name);
  if (_isNullOrEmpty) {
    name = "Unknown";
  }
  ClientGameEnvironmentImpl _l15remote = Startup.l15remote(name, this.ipAddr);
  this.environment = _l15remote;
  final ErrorMessage error = this.environment.joinGame(this.gameId);
  boolean _isFailed = error.isFailed();
  if (_isFailed) {
    ExceptionCode _errorCode = error.getErrorCode();
    String _errorMessage = error.getErrorMessage();
    throw new BaseException(_errorCode, _errorMessage);
  }
}
项目:abattle    文件:GameParameterPartScreen.java   
public GameBaseParametersImpl getGameParameters() {
  ComponentLookup _instance = ComponentLookup.getInstance();
  ConfigurationComponent _component = _instance.<ConfigurationComponent>getComponent(ConfigurationComponent.class);
  GlobalOptionsData _globalOptions = _component.getGlobalOptions();
  String name = _globalOptions.getName();
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(name);
  if (_isNullOrEmpty) {
    String _get = I18N.get("gp_unknown");
    name = _get;
  }
  if (this.humans) {
    int _playerCount = this.configuration.getPlayerCount();
    int _xsize = this.configuration.getXsize();
    int _ysize = this.configuration.getYsize();
    return new GameBaseParametersImpl(0, _playerCount, _xsize, _ysize, name);
  } else {
    int _playerCount_1 = this.configuration.getPlayerCount();
    int _xsize_1 = this.configuration.getXsize();
    int _ysize_1 = this.configuration.getYsize();
    return new GameBaseParametersImpl(_playerCount_1, 1, _xsize_1, _ysize_1, name);
  }
}
项目:abattle    文件:ClientModelComponentImpl.java   
@Override
public void waitForClientId() {
  try {
    boolean _tryAcquire = this.waitForId.tryAcquire(3, TimeUnit.SECONDS);
    boolean _not = (!_tryAcquire);
    if (_not) {
      throw new BaseException(ModelExceptionCode.LOGIN_TIMEOUT);
    }
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(this.errorMessage);
    boolean _not_1 = (!_isNullOrEmpty);
    if (_not_1) {
      throw new BaseException(ModelExceptionCode.LOGIN_FAILED, this.errorMessage);
    }
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
项目:abattle    文件:DirtyAccessorsProcessor.java   
public List<String> getPossibleGetterNames(final FieldDeclaration it) {
    List<String> _xifexpression = null;
    final TypeReference _type = it.getType();
    final TypeReference _orObject = this.orObject(_type);
    final boolean _isBooleanType = this.isBooleanType(_orObject);
    if (_isBooleanType) {
        _xifexpression = Collections.<String> unmodifiableList(CollectionLiterals.<String> newArrayList("is", "get"));
    } else {
        _xifexpression = Collections.<String> unmodifiableList(CollectionLiterals.<String> newArrayList("get"));
    }
    final Function1<String, String> _function = new Function1<String, String>() {
        @Override
        public String apply(final String prefix) {
            final String _simpleName = it.getSimpleName();
            final String _firstUpper = StringExtensions.toFirstUpper(_simpleName);
            return (prefix + _firstUpper);
        }
    };
    return ListExtensions.<String, String> map(_xifexpression, _function);
}
项目:xtext-maven-example    文件:LaunchConfigurationInfo.java   
public boolean isValid() {
  boolean _and = false;
  boolean _and_1 = false;
  String _clazz = this.getClazz();
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_clazz);
  boolean _not = (!_isNullOrEmpty);
  if (!_not) {
    _and_1 = false;
  } else {
    String _project = this.getProject();
    boolean _isNullOrEmpty_1 = StringExtensions.isNullOrEmpty(_project);
    boolean _not_1 = (!_isNullOrEmpty_1);
    _and_1 = _not_1;
  }
  if (!_and_1) {
    _and = false;
  } else {
    String _task = this.getTask();
    boolean _isNullOrEmpty_2 = StringExtensions.isNullOrEmpty(_task);
    boolean _not_2 = (!_isNullOrEmpty_2);
    _and = _not_2;
  }
  return _and;
}
项目:xtext-maven-example    文件:LaunchConfigurationInfo.java   
public boolean isValid() {
  boolean _and = false;
  boolean _and_1 = false;
  String _clazz = this.getClazz();
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_clazz);
  boolean _not = (!_isNullOrEmpty);
  if (!_not) {
    _and_1 = false;
  } else {
    String _project = this.getProject();
    boolean _isNullOrEmpty_1 = StringExtensions.isNullOrEmpty(_project);
    boolean _not_1 = (!_isNullOrEmpty_1);
    _and_1 = _not_1;
  }
  if (!_and_1) {
    _and = false;
  } else {
    String _task = this.getTask();
    boolean _isNullOrEmpty_2 = StringExtensions.isNullOrEmpty(_task);
    boolean _not_2 = (!_isNullOrEmpty_2);
    _and = _not_2;
  }
  return _and;
}
项目:xsemantics    文件:TypeSystem.java   
protected Result<Boolean> applyRuleEClassEClass(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass1, final EClass eClass2) throws RuleFailedException {
  String _string = new String();
  String _firstUpper = StringExtensions.toFirstUpper("bar");
  String _plus = (_string + _firstUpper);
  boolean _equals = Objects.equal("foo", _plus);
  /* 'foo' == new String() + 'bar'.toFirstUpper */
  if (!_equals) {
    sneakyThrowRuleFailedException("\'foo\' == new String() + \'bar\'.toFirstUpper");
  }
  final EClass eC = EcoreFactory.eINSTANCE.createEClass();
  eC.setName("MyEClass");
  /* eClass1 == eC */
  if (!Objects.equal(eClass1, eC)) {
    sneakyThrowRuleFailedException("eClass1 == eC");
  }
  return new Result<Boolean>(true);
}
项目:xsemantics    文件:TypeSystem.java   
protected Result<Boolean> applyRuleEClassEObject(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass, final EObject object) throws RuleFailedException {
  String _string = new String();
  String _firstUpper = StringExtensions.toFirstUpper("bar");
  String _plus = (_string + _firstUpper);
  boolean _equals = Objects.equal("foo", _plus);
  /* 'foo' == new String() + 'bar'.toFirstUpper */
  if (!_equals) {
    sneakyThrowRuleFailedException("\'foo\' == new String() + \'bar\'.toFirstUpper");
  }
  final EClass eC = EcoreFactory.eINSTANCE.createEClass();
  eC.setName("MyEClass");
  /* eClass == eC */
  if (!Objects.equal(eClass, eC)) {
    sneakyThrowRuleFailedException("eClass == eC");
  }
  return new Result<Boolean>(true);
}
项目:xsemantics    文件:TypeSystem.java   
protected Result<Boolean> applyRuleEClassEObject(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass, final EObject object) throws RuleFailedException {
  String _string = new String();
  String _firstUpper = StringExtensions.toFirstUpper("bar");
  String _plus = (_string + _firstUpper);
  boolean _equals = Objects.equal("foo", _plus);
  /* 'foo' == new String() + 'bar'.toFirstUpper */
  if (!_equals) {
    sneakyThrowRuleFailedException("\'foo\' == new String() + \'bar\'.toFirstUpper");
  }
  final EClass eC = EcoreFactory.eINSTANCE.createEClass();
  eC.setName("MyEClass");
  /* eClass == eC */
  if (!Objects.equal(eClass, eC)) {
    sneakyThrowRuleFailedException("eClass == eC");
  }
  return new Result<Boolean>(true);
}
项目:xsemantics    文件:TypeSystem.java   
protected Result<Boolean> applyRuleEClassEClass(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass1, final EClass eClass2) throws RuleFailedException {
  String _string = new String();
  String _firstUpper = StringExtensions.toFirstUpper("bar");
  String _plus = (_string + _firstUpper);
  boolean _equals = Objects.equal("foo", _plus);
  /* 'foo' == new String() + 'bar'.toFirstUpper */
  if (!_equals) {
    sneakyThrowRuleFailedException("\'foo\' == new String() + \'bar\'.toFirstUpper");
  }
  final EClass eC = EcoreFactory.eINSTANCE.createEClass();
  eC.setName("MyEClass");
  /* eClass1 == eC */
  if (!Objects.equal(eClass1, eC)) {
    sneakyThrowRuleFailedException("eClass1 == eC");
  }
  return new Result<Boolean>(true);
}
项目:xsemantics    文件:TypeSystem.java   
protected Result<Boolean> applyRuleEClassEObject(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass, final EObject object) throws RuleFailedException {
  String _string = new String();
  String _firstUpper = StringExtensions.toFirstUpper("bar");
  String _plus = (_string + _firstUpper);
  boolean _equals = Objects.equal("foo", _plus);
  /* 'foo' == new String() + 'bar'.toFirstUpper */
  if (!_equals) {
    sneakyThrowRuleFailedException("\'foo\' == new String() + \'bar\'.toFirstUpper");
  }
  final EClass eC = EcoreFactory.eINSTANCE.createEClass();
  eC.setName("MyEClass");
  /* eClass == eC */
  if (!Objects.equal(eClass, eC)) {
    sneakyThrowRuleFailedException("eClass == eC");
  }
  return new Result<Boolean>(true);
}
项目:xsemantics    文件:TypeSystem.java   
protected Result<Boolean> applyRuleEClassEClass(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass1, final EClass eClass2) throws RuleFailedException {
  String _string = new String();
  String _firstUpper = StringExtensions.toFirstUpper("bar");
  String _plus = (_string + _firstUpper);
  boolean _equals = Objects.equal("foo", _plus);
  /* 'foo' == new String() + 'bar'.toFirstUpper */
  if (!_equals) {
    sneakyThrowRuleFailedException("\'foo\' == new String() + \'bar\'.toFirstUpper");
  }
  final EClass eC = EcoreFactory.eINSTANCE.createEClass();
  eC.setName("MyEClass");
  /* eClass1 == eC */
  if (!Objects.equal(eClass1, eC)) {
    sneakyThrowRuleFailedException("eClass1 == eC");
  }
  return new Result<Boolean>(true);
}
项目:packtpub-xtext-book-examples    文件:EntitiesQuickfixProvider.java   
@Fix(EntitiesValidator.INVALID_ENTITY_NAME)
public void capitalizeEntityNameFirstLetter(final Issue issue, final IssueResolutionAcceptor acceptor) {
  String[] _data = issue.getData();
  String _get = _data[0];
  String _plus = ("Capitalize first letter of \'" + _get);
  String _plus_1 = (_plus + "\'");
  final IModification _function = new IModification() {
    @Override
    public void apply(final IModificationContext context) throws Exception {
      final IXtextDocument xtextDocument = context.getXtextDocument();
      Integer _offset = issue.getOffset();
      final String firstLetter = xtextDocument.get((_offset).intValue(), 1);
      Integer _offset_1 = issue.getOffset();
      String _firstUpper = StringExtensions.toFirstUpper(firstLetter);
      xtextDocument.replace((_offset_1).intValue(), 1, _firstUpper);
    }
  };
  acceptor.accept(issue, 
    "Capitalize first letter", _plus_1, 
    "Entity.gif", _function);
}
项目:n4js    文件:InstallNpmDependencyButtonListener.java   
@Override
public void widgetSelected(final SelectionEvent e) {
    final MultiStatus multistatus = statusHelper.createMultiStatus("Status of installing npm dependencies.");

    InstallNpmDependencyDialog dialog = new InstallNpmDependencyDialog(getShell(),
            packageNameValidator.get(), packageVersionValidator.get());
    dialog.open();
    final String packageName = dialog.getPackageName();
    if (!StringExtensions.isNullOrEmpty(packageName) && dialog.getReturnCode() == Window.OK) {
        try {
            final String packageVersion = dialog.getVersionConstraint();
            new ProgressMonitorDialog(getShell()).run(true, false, monitor -> {
                multistatus
                        .merge(installAction.apply(Collections.singletonMap(packageName, packageVersion), monitor));
            });
        } catch (final InvocationTargetException | InterruptedException exc) {
            multistatus.merge(
                    statusHelper.createError("Error while installing npm dependency: '" + packageName + "'.",
                            exc));
        } finally {
            if (!multistatus.isOK()) {
                N4JSActivator.getInstance().getLog().log(multistatus);
                getDisplay().asyncExec(() -> openError(
                        UIUtils.getShell(),
                        "npm Install Failed",
                        "Error while installing '" + packageName
                                + "' npm package.\nPlease check your Error Log view for the detailed npm log about the failure."));
            }
        }
    }
}
项目:n4js    文件:UninstallNpmDependencyButtonListener.java   
@Override
public void widgetSelected(final SelectionEvent e) {
    final MultiStatus multistatus = statusHelper.createMultiStatus("Status of uninstalling npm dependencies.");

    final InputDialog dialog = new InputDialog(UIUtils.getShell(), "npm Uninstall",
            "Specify an npm package name to uninstall:", initalValue.get(), validator.get());

    dialog.open();
    final String packageName = dialog.getValue();
    if (!StringExtensions.isNullOrEmpty(packageName) && dialog.getReturnCode() == Window.OK) {
        try {
            new ProgressMonitorDialog(UIUtils.getShell()).run(true, false, monitor -> {
                multistatus.merge(uninstallAction.apply(Arrays.asList(packageName), monitor));
            });
        } catch (final InvocationTargetException | InterruptedException exc) {
            multistatus.merge(
                    statusHelper.createError("Error while uninstalling npm dependency: '" + packageName + "'.",
                            exc));
        } finally {
            if (!multistatus.isOK()) {
                N4JSActivator.getInstance().getLog().log(multistatus);
                getDisplay().asyncExec(() -> openError(
                        UIUtils.getShell(),
                        "npm Uninstall Failed",
                        "Error while uninstalling '" + packageName
                                + "' npm package.\nPlease check your Error Log view for the detailed npm log about the failure."));
            }
        }
    }
}
项目:xtext-extras    文件:JvmModelGenerator.java   
public void generateFileHeader(final JvmDeclaredType it, final ITreeAppendable appendable, final GeneratorConfig config) {
  final FileHeaderAdapter fileHeaderAdapter = IterableExtensions.<FileHeaderAdapter>head(Iterables.<FileHeaderAdapter>filter(it.eAdapters(), FileHeaderAdapter.class));
  String _headerText = null;
  if (fileHeaderAdapter!=null) {
    _headerText=fileHeaderAdapter.getHeaderText();
  }
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_headerText);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    this.generateDocumentation(fileHeaderAdapter.getHeaderText(), this.fileHeaderProvider.getFileHeaderNodes(it.eResource()), appendable, config);
  }
}
项目:xtext-extras    文件:ValidatorNaming.java   
public String getGeneratedEPackageName(final EPackage pack) {
  StringConcatenation _builder = new StringConcatenation();
  String _basePackageRuntime = this._naming.basePackageRuntime(this.grammar);
  _builder.append(_basePackageRuntime);
  _builder.append(".");
  String _name = pack.getName();
  _builder.append(_name);
  _builder.append(".");
  String _firstUpper = StringExtensions.toFirstUpper(pack.getName());
  _builder.append(_firstUpper);
  _builder.append("Package");
  return _builder.toString();
}
项目:xtext-core    文件:SignatureHelpServiceImpl.java   
@Override
public SignatureHelp getSignatureHelp(final XtextResource resource, final int offset) {
  Preconditions.<XtextResource>checkNotNull(resource, "resource");
  Preconditions.checkArgument((offset >= 0), ("offset >= 0. Was: " + Integer.valueOf(offset)));
  final EObject object = this.offsetHelper.resolveContainedElementAt(resource, offset);
  if ((object instanceof OperationCall)) {
    final String operationName = this.getOperationName(((OperationCall)object));
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(operationName);
    boolean _not = (!_isNullOrEmpty);
    if (_not) {
      return this.getSignatureHelp(((OperationCall)object), operationName, offset);
    }
  }
  return ISignatureHelpService.EMPTY;
}
项目:xtext-core    文件:ValidatorFragment2.java   
protected String getGeneratedEPackageName(final EPackage pack) {
  StringConcatenation _builder = new StringConcatenation();
  String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(this.getGrammar());
  _builder.append(_runtimeBasePackage);
  _builder.append(".");
  String _name = pack.getName();
  _builder.append(_name);
  _builder.append(".");
  String _firstUpper = StringExtensions.toFirstUpper(pack.getName());
  _builder.append(_firstUpper);
  _builder.append("Package");
  return _builder.toString();
}