當前位置: 首頁>>代碼示例>>Java>>正文


Java EValidator.Registry方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:vrapio,項目名稱:rest-modeling-framework,代碼行數:23,代碼來源:RamlValidationSetup.java

示例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;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:19,代碼來源:ValidatorTester.java

示例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);
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:22,代碼來源:CheckExtensionGenerator.java

示例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());
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:9,代碼來源:InputConstraintHelper.java

示例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);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:7,代碼來源:AbstractTypeProviderTest.java

示例6: XbaseDiagnostician

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Inject
public XbaseDiagnostician(EValidator.Registry registry) {
	super(registry);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:5,代碼來源:XbaseDiagnostician.java

示例7: setRegistry

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public void setRegistry(EValidator.Registry registry) {
	this.registry = registry;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:4,代碼來源:EValidatorRegistrar.java

示例8: getRegistry

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public EValidator.Registry getRegistry() {
	return registry;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:4,代碼來源:EValidatorRegistrar.java

示例9: CancelableDiagnostician

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Inject
public CancelableDiagnostician(EValidator.Registry registry) {
	super(registry);
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:5,代碼來源:CancelableDiagnostician.java

示例10: bindEValidatorRegistry

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public EValidator.Registry bindEValidatorRegistry() {
	return EValidator.Registry.INSTANCE;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:4,代碼來源:DefaultRuntimeModule.java

示例11: Diagnostician

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public Diagnostician(EValidator.Registry eValidatorRegistry)
{
  this.eValidatorRegistry = eValidatorRegistry;
}
 
開發者ID:LangleyStudios,項目名稱:eclipse-avro,代碼行數:5,代碼來源:Diagnostician.java

示例12: EValidatorRegistryImpl

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
public EValidatorRegistryImpl(EValidator.Registry delegateRegistry)
{
  this.delegateRegistry = delegateRegistry;
}
 
開發者ID:LangleyStudios,項目名稱:eclipse-avro,代碼行數:5,代碼來源:EValidatorRegistryImpl.java


注:本文中的org.eclipse.emf.ecore.EValidator.Registry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。