@Inject public ValidatorTester(T validator, EValidatorRegistrar registrar, @Named(Constants.LANGUAGE_NAME) final String languageName) { this.validator = validator; EValidator.Registry originalRegistry = registrar.getRegistry(); EValidatorRegistryImpl newRegistry = new EValidatorRegistryImpl(); registrar.setRegistry(newRegistry); this.validator.register(registrar); diagnostician = new Diagnostician(newRegistry) { @Override public java.util.Map<Object,Object> createDefaultContext() { java.util.Map<Object,Object> map = super.createDefaultContext(); map.put(AbstractInjectableValidator.CURRENT_LANGUAGE_NAME, languageName); return map; } }; registrar.setRegistry(originalRegistry); validatorCalled = false; }
@Inject protected void register(final EValidatorRegistrar registrar, final IGrammarAccess grammarAccess) { final AbstractRule entryRule = IterableExtensions.<AbstractRule>head(grammarAccess.getGrammar().getRules()); if ((entryRule instanceof ParserRule)) { registrar.register(((ParserRule)entryRule).getType().getClassifier().getEPackage(), this); } }
/** * NEEDED, when removed check methods will be called twice once by N4JSValidator, and once by * AbstractDeclarativeN4JSValidator */ @Override public void register(EValidatorRegistrar registrar) { // nop }
@Override public void register(EValidatorRegistrar registrar) { // do nothing }
@Override public void register(final EValidatorRegistrar registrar) { }
public ValidatorTester(T validator, Injector injector) { this(validator, injector.getInstance(EValidatorRegistrar.class), injector.getInstance(Key.get(String.class, Names.named(Constants.LANGUAGE_NAME)))); }
@Override public void register(final EValidatorRegistrar registrar) { // do nothing }
@Override @Inject public void register(EValidatorRegistrar registrar) { // Do not register because this validator is only a composite #398987 }
@Inject public void register(EValidatorRegistrar registrar) { // Do not register because this validator is only a composite #398987 }
@Override public void register(EValidatorRegistrar registrar) { return; }
@Inject public void registerAgain(EValidatorRegistrar registrar) { super.register(registrar); }
@Override public void register(EValidatorRegistrar registrar) { // Since this is a composed check we prevent it from registering on its // own }
@Override public void register(EValidatorRegistrar registrar) { // Since this is a composed check we prevent it from registering on its own }
/** * NEEEDED * * when removed check methods will be called twice once by N4JSValidator, and once by * AbstractDeclarativeN4JSValidator */ @Override public void register(EValidatorRegistrar registrar) { // nop }
/** * NEEDED * * when removed check methods will be called twice once by N4JSValidator, and once by * AbstractDeclarativeN4JSValidator */ @Override public void register(EValidatorRegistrar registrar) { // nop }
/** * NEEEDED * * when removed check methods will be called twice once by N4JSValidator, and once by * AbstractDeclarativeN4JSValidator */ @Override public void register(EValidatorRegistrar registrar) { /* nop */ }
/** * Override with empty implementation since indirectly referenced {@link #grammarAccess} has not been injected at this point. {@inheritDoc} */ @Override public void register(final EValidatorRegistrar registrar) {}
/** * At this point, {@link #grammarAccess} has been injected. See {@link #register(EValidatorRegistrar)}. * * @param registrar * the validator registrar */ @Inject public void register2(final EValidatorRegistrar registrar) { super.register(registrar); }
void register(EValidatorRegistrar registrar);