コード例 #1
0
 @Check
 public void checkConstantUppercase(final MobaConstantValue value) {
   String _valueString = value.getValueString();
   boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_valueString);
   boolean _not = (!_isNullOrEmpty);
   if (_not) {
     MobaConstant _valueConst = value.getValueConst();
     boolean _notEquals = (!Objects.equal(_valueConst, null));
     if (_notEquals) {
       MobaConstant _valueConst_1 = value.getValueConst();
       String _value = _valueConst_1.getValue();
       String _upperCase = _value.toUpperCase();
       MobaConstant _valueConst_2 = value.getValueConst();
       String _value_1 = _valueConst_2.getValue();
       boolean _equals = _upperCase.equals(_value_1);
       boolean _not_1 = (!_equals);
       if (_not_1) {
         StringConcatenation _builder = new StringConcatenation();
         _builder.append("Constant values need to be upper case!");
         this.error(
             _builder.toString(), value, MobaPackage.Literals.MOBA_CONSTANT_VALUE__VALUE_CONST);
       }
     }
   }
 }
コード例 #2
0
 @Check
 public void checkCacheInterval(final MobaCache cache) {
   boolean _and = false;
   MobaConstant _cacheIntervalConst = cache.getCacheIntervalConst();
   boolean _notEquals = (!Objects.equal(_cacheIntervalConst, null));
   if (!_notEquals) {
     _and = false;
   } else {
     MobaConstant _cacheIntervalConst_1 = cache.getCacheIntervalConst();
     MobaConstantValue _valueAST = _cacheIntervalConst_1.getValueAST();
     ValueType _valueType = _valueAST.getValueType();
     boolean _notEquals_1 = (!Objects.equal(_valueType, ValueType.NUMERIC));
     _and = _notEquals_1;
   }
   if (_and) {
     this.error(
         "The constant for interval needs to be a numeric type constant.",
         cache,
         MobaPackage.Literals.MOBA_CACHE__CACHE_INTERVAL_CONST);
   }
 }