本文整理匯總了Java中org.eclipse.emf.ecore.EValidator.Registry方法的典型用法代碼示例。如果您正苦於以下問題:Java EValidator.Registry方法的具體用法?Java EValidator.Registry怎麽用?Java EValidator.Registry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.emf.ecore.EValidator
的用法示例。
在下文中一共展示了EValidator.Registry方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
/**
* Registers validators.
*/
static void setup() {
final EValidator.Registry registry = EValidator.Registry.INSTANCE;
registry.put(TypesPackage.eINSTANCE, new TypesValidator());
registry.put(ModulesPackage.eINSTANCE, new ModulesValidator());
registry.put(ResourcesPackage.eINSTANCE, new ResourcesValidator());
registry.put(ResponsesPackage.eINSTANCE, new ResponsesValidator());
final RamlObjectValidator ramlObjectValidator = new RamlObjectValidator();
for (final EPackage ePackage : PACKAGES) {
final CompositeValidator compositeValidator = new CompositeValidator();
compositeValidator.add(ramlObjectValidator);
final EValidator validator = registry.getEValidator(ePackage);
if (validator != null) {
compositeValidator.add(validator);
}
registry.put(ePackage, compositeValidator);
}
}
示例2: ValidatorTester
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@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;
}
示例3: catalogValidates
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
/**
* Catalog validates.
*
* @param catalog
* the catalog
* @return true, if successful
*/
private boolean catalogValidates(final CheckCatalog catalog) {
EValidator.Registry eValidatorRegistry = EValidator.Registry.INSTANCE;
EValidator eValidator = eValidatorRegistry.getEValidator(catalog.eClass().getEPackage());
BasicDiagnostic diag = new BasicDiagnostic();
eValidator.validate(catalog, diag, Maps.newHashMap());
Iterable<Diagnostic> children = diag.getChildren();
Iterable<Diagnostic> errors = Iterables.filter(children, new Predicate<Diagnostic>() {
@Override
public boolean apply(final Diagnostic input) {
return input.getSeverity() == Diagnostic.ERROR;
}
});
return Iterables.isEmpty(errors);
}
示例4: InputConstraintHelper
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Inject
private InputConstraintHelper(final IParser parser, final ISerializer serializer, final EValidator.Registry validatorRegistry, final IGrammarAccess grammarAccess) {
this.parser = Objects.requireNonNull(parser, "parser must not be null");
this.serializer = Objects.requireNonNull(serializer, "serializer must not be null");
this.validator = Objects.requireNonNull(validatorRegistry, "validatorRegistry must not be null").getEValidator(InputConstraintPackage.eINSTANCE);
Objects.requireNonNull(grammarAccess, "grammarAccess must not be null");
validationContext.put(InputConstraintValidator.CURRENT_LANGUAGE_NAME, grammarAccess.getGrammar().getName());
}
示例5: setUp
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
EValidator.Registry registry = new EValidatorRegistryImpl(EValidator.Registry.INSTANCE);
registry.put(TypesPackage.eINSTANCE, new EObjectValidator());
diagnostician = new Diagnostician(registry);
}
示例6: XbaseDiagnostician
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Inject
public XbaseDiagnostician(EValidator.Registry registry) {
super(registry);
}
示例7: setRegistry
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public void setRegistry(EValidator.Registry registry) {
this.registry = registry;
}
示例8: getRegistry
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public EValidator.Registry getRegistry() {
return registry;
}
示例9: CancelableDiagnostician
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Inject
public CancelableDiagnostician(EValidator.Registry registry) {
super(registry);
}
示例10: bindEValidatorRegistry
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public EValidator.Registry bindEValidatorRegistry() {
return EValidator.Registry.INSTANCE;
}
示例11: Diagnostician
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public Diagnostician(EValidator.Registry eValidatorRegistry)
{
this.eValidatorRegistry = eValidatorRegistry;
}
示例12: EValidatorRegistryImpl
import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public EValidatorRegistryImpl(EValidator.Registry delegateRegistry)
{
this.delegateRegistry = delegateRegistry;
}