package jetbrains.mps.baseLanguage.regexp.constraints; /*Generated by MPS */ import jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import java.util.Map; import org.jetbrains.mps.openapi.language.SProperty; import jetbrains.mps.smodel.runtime.PropertyConstraintsDescriptor; import java.util.HashMap; import jetbrains.mps.smodel.runtime.base.BasePropertyConstraintsDescriptor; import jetbrains.mps.smodel.adapter.ids.MetaIdFactory; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; public class LiteralReplacement_Constraints extends BaseConstraintsDescriptor { public LiteralReplacement_Constraints() { super(MetaAdapterFactory.getConcept(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x34ae970c192ab94cL, "jetbrains.mps.baseLanguage.regexp.structure.LiteralReplacement")); } @Override protected Map<SProperty, PropertyConstraintsDescriptor> getSpecifiedProperties() { Map<SProperty, PropertyConstraintsDescriptor> properties = new HashMap<SProperty, PropertyConstraintsDescriptor>(); properties.put(MetaAdapterFactory.getProperty(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x34ae970c192ab94cL, 0x34ae970c192b203bL, "text"), new BasePropertyConstraintsDescriptor(MetaIdFactory.propId(0xdaafa647f1f74b0bL, 0xb09669cd7c8408c0L, 0x34ae970c192ab94cL, 0x34ae970c192b203bL), this) { @Override public boolean hasOwnValidator() { return true; } @Override public boolean validateValue(SNode node, String propertyValue) { String propertyName = "text"; return (SPropertyOperations.getString(propertyValue)).indexOf(" ") < 1; } }); return properties; } }