org.eclipse.xtext.validation.AbstractDeclarativeValidator Java Examples

The following examples show how to use org.eclipse.xtext.validation.AbstractDeclarativeValidator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FjActualGeneratedValidatorTests.java    From xsemantics with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected FjCustomRuntimeModuleForTesting createFjCustomRuntimeModule() {
	return new FjCustomRuntimeModuleForTesting(fjTypeSystemClass()) {

		@Override
		public Class<? extends AbstractDeclarativeValidator> bindAbstractDeclarativeValidator() {
			return CustomFjTypeSystemValidator.class;
		}

		@SuppressWarnings("unused")
		public java.lang.Class<? extends FjExpectedTraces> bindFjExpectedTraces() {
			return FjActualExpectedTraces.class;
		}

	};
}
 
Example #2
Source File: FjSepGeneratedValidatorTests.java    From xsemantics with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected FjCustomRuntimeModuleForTesting createFjCustomRuntimeModule() {
	return new FjCustomRuntimeModuleForTesting(fjTypeSystemClass()) {

		@Override
		public Class<? extends AbstractDeclarativeValidator> bindAbstractDeclarativeValidator() {
			return CustomFjTypeSystemValidator.class;
		}

		@SuppressWarnings("unused")
		public java.lang.Class<? extends FjExpectedTraces> bindFjExpectedTraces() {
			return FjSepExpectedTraces.class;
		}

	};
}
 
Example #3
Source File: FjAltGeneratedValidatorTests.java    From xsemantics with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected FjCustomRuntimeModuleForTesting createFjCustomRuntimeModule() {
	return new FjCustomRuntimeModuleForTesting(fjTypeSystemClass()) {

		@Override
		public Class<? extends AbstractDeclarativeValidator> bindAbstractDeclarativeValidator() {
			return CustomFjTypeSystemValidator.class;
		}
		
		@SuppressWarnings("unused")
		public java.lang.Class<? extends FjExpectedTraces> bindFjExpectedTraces() {
			return FjAltExpectedTraces.class;
		}

	};
}
 
Example #4
Source File: AbstractPackageJSONValidatorExtension.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public MethodWrapper createMethodWrapper(AbstractDeclarativeValidator instanceToUse, Method method) {
	boolean isCheckMethodInsideThisClass = method
			.getDeclaringClass() == AbstractPackageJSONValidatorExtension.class;
	if (isCheckMethodInsideThisClass) {
		// Must not do performance measuring for the @Check method inside this class, because it will invoke (and
		// measure) the more fine-grained @CheckProperty methods. Without this, we would count those validations
		// twice!
		return super.createMethodWrapper(instanceToUse, method);
	}
	return new N4JSMethodWrapperCancelable(instanceToUse, method, operationCanceledManager);
}
 
Example #5
Source File: FjFirstGeneratedValidatorTests.java    From xsemantics with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected FjCustomRuntimeModuleForTesting createFjCustomRuntimeModule() {
	return new FjCustomRuntimeModuleForTesting(fjTypeSystemClass()) {

		@Override
		public Class<? extends AbstractDeclarativeValidator> bindAbstractDeclarativeValidator() {
			return FjFirstTypeSystemValidator.class;
		}
		
	};
}
 
Example #6
Source File: FjAbstractGeneratedValidatorTests.java    From xsemantics with Eclipse Public License 1.0 5 votes vote down vote up
@Override
@Before
public void setUp() throws Exception {
	super.setUp();
	with(fjCustomStandaloneSetupClass());
	tester = new ValidatorTester<AbstractDeclarativeValidator>(
			get(AbstractDeclarativeValidator.class), getInjector());
	expectedTraces = get(FjExpectedTraces.class);
}
 
Example #7
Source File: ValidatorFragment2.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected TypeReference getDefaultValidatorSuperClass() {
  return new TypeReference(AbstractDeclarativeValidator.class);
}
 
Example #8
Source File: FjCustomRuntimeModuleForTesting.java    From xsemantics with Eclipse Public License 1.0 4 votes vote down vote up
public java.lang.Class<? extends AbstractDeclarativeValidator> bindAbstractDeclarativeValidator() {
	return NullTestValidator.class;
}