Java 类org.eclipse.emf.ecore.EValidator 实例源码

项目:gemoc-studio-modeldebugging    文件:DSLBreakpoint.java   
/**
 * Sets attributes for the given {@link IMarker}.
 * 
 * @param marker
 *            the {@link IMarker}
 * @param resource
 *            the {@link IFile} containing the mode
 * @param instruction
 *            the {@link EObject} representing the instruction
 * @param persistent
 *            should be persisted
 * @throws CoreException
 *             if attributes can't be set
 */
protected void setMarkerAttibutes(final IMarker marker, IFile resource, EObject instruction,
        boolean persistent) throws CoreException {
    final IItemLabelProvider provider = (IItemLabelProvider)ADAPTER_FACTORY.adapt(instruction,
            IItemLabelProvider.class);
    marker.setAttribute(IBreakpoint.ENABLED, true);
    marker.setAttribute(IBreakpoint.PERSISTED, persistent);
    marker.setAttribute(IBreakpoint.ID, getModelIdentifier());
    marker.setAttribute(EValidator.URI_ATTRIBUTE, EcoreUtil.getURI(instruction).toString());
    final String instructionText = provider.getText(instruction);
    marker.setAttribute(IMarker.MESSAGE, "DSL Breakpoint: " + resource.getFullPath() + " ["
            + instructionText + "]");
    try {
        marker.setAttribute(IMAGE_ATTRIBUTE, toAttribute(provider.getImage(instruction)));
    } catch (IOException e) {
        Activator.getDefault().error(e);
    }
    marker.setAttribute(TEXT_ATTRIBUTE, instructionText);
}
项目:gemoc-studio-modeldebugging    文件:SiriusEditorUtils.java   
/**
 * Show the given {@link EObject instruction}.
 * 
 * @param editorPart
 *            the opened {@link DialectEditor}
 * @param instruction
 *            the {@link EObject instruction} to show
 */
public static void showInstruction(DialectEditor editorPart, EObject instruction) {
    final URI resourceURI = instruction.eResource().getURI();
    if (resourceURI.isPlatformResource()) {
        final String resourcePath = resourceURI.toPlatformString(true);
        final IResource resource = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(
                resourcePath));
        try {
            final IMarker marker = resource.createMarker(EValidator.MARKER);
            marker.setAttribute(EValidator.URI_ATTRIBUTE, EcoreUtil.getURI(instruction).toString());
            final TraceabilityMarkerNavigationProvider navigationProvider = new TraceabilityMarkerNavigationProvider(
                    (DialectEditor)editorPart);
            navigationProvider.gotoMarker(marker);
            marker.delete();
        } catch (CoreException e) {
            DebugSiriusIdeUiPlugin.INSTANCE.log(e);
        }
    }
}
项目:neoscada    文件:ExtensibleValidator.java   
@Override
public boolean validate ( final EObject eObject, final DiagnosticChain diagnostics, final Map<Object, Object> context )
{
    boolean result = true;
    for ( final EValidator v : this.otherValidators )
    {
        if ( !v.validate ( eObject, diagnostics, context ) )
        {
            result = false;
        }
    }

    ValidationPlugin.runValidation ( eObject, diagnostics, context );

    return result;
}
项目:neoscada    文件:ExtensibleValidator.java   
@Override
public boolean validate ( final EClass eClass, final EObject eObject, final DiagnosticChain diagnostics, final Map<Object, Object> context )
{
    boolean result = true;
    for ( final EValidator v : this.otherValidators )
    {
        if ( !v.validate ( eClass, eObject, diagnostics, context ) )
        {
            result = false;
        }
    }

    ValidationPlugin.runValidation ( eObject, diagnostics, context );

    return result;
}
项目:rest-modeling-framework    文件:RamlValidationSetup.java   
/**
 * 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);
    }
}
项目:xtext-core    文件:CompositeEValidator.java   
@Override
public boolean equals(Object obj) {
    if (!(obj instanceof EValidatorEqualitySupport))
        return false;
    EValidator otherDelegate = ((EValidatorEqualitySupport) obj).getDelegate();
    if (otherDelegate.getClass().equals(getDelegate().getClass())) {
        if (delegate instanceof AbstractInjectableValidator) {
            AbstractInjectableValidator casted = (AbstractInjectableValidator) getDelegate();
            AbstractInjectableValidator otherCasted = (AbstractInjectableValidator) otherDelegate;
            if (casted.isLanguageSpecific() == otherCasted.isLanguageSpecific()) {
                if (casted.isLanguageSpecific()) {
                    return Objects.equal(casted.getLanguageName(), otherCasted.getLanguageName());
                }
                return true;
            }
            return false;
        }
        return true;
    }
    return false;
}
项目:xtext-core    文件:GlobalRegistries.java   
public static GlobalStateMemento makeCopyOfGlobalState() {
    GlobalStateMemento memento = new GlobalStateMemento();
    memento.validatorReg = new HashMap<EPackage, Object>(EValidator.Registry.INSTANCE);
    for(Map.Entry<EPackage, Object> validatorEntry: memento.validatorReg.entrySet()) {
        Object existingValue = validatorEntry.getValue();
        if (existingValue instanceof CompositeEValidator) {
            validatorEntry.setValue(((CompositeEValidator) existingValue).getCopyAndClearContents());
        }
    }
    memento.epackageReg = new HashMap<String, Object>(EPackage.Registry.INSTANCE);
    memento.protocolToFactoryMap = new HashMap<String, Object>(Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap());
    memento.extensionToFactoryMap = new HashMap<String, Object>(Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap());
    memento.contentTypeIdentifierToFactoryMap = new HashMap<String, Object>(Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap());

    memento.protocolToServiceProviderMap = new HashMap<String, Object>(IResourceServiceProvider.Registry.INSTANCE.getProtocolToFactoryMap());
    memento.extensionToServiceProviderMap = new HashMap<String, Object>(IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap());
    memento.contentTypeIdentifierToServiceProviderMap = new HashMap<String, Object>(IResourceServiceProvider.Registry.INSTANCE.getContentTypeToFactoryMap());
    return memento;
}
项目:xtext-core    文件:ValidatorTester.java   
@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;
}
项目:xtext-core    文件:AbstractCompositeValidatorTest.java   
@Test public void testBug_279962() {
    EValidator validator = registry.getEValidator(pack);
    assertTrue(validator instanceof CompositeEValidator);
    CompositeEValidator composite = (CompositeEValidator) validator;

    int prevSize = composite.getContents().size();

    get(Val_279962_01.class);
    get(Val_279962_04.class);
    assertEquals(prevSize + 2, composite.getContents().size());
    assertNotNull(validator);
    Resource resource = get(XtextResource.class);
    Model model = EnumRulesTestLanguageFactory.eINSTANCE.createModel();
    resource.getContents().add(model);
    // do not expect an exception
    validator.validate(model, new BasicDiagnostic(), null);
    assertEquals(prevSize + 4, composite.getContents().size());
}
项目:xtext-core    文件:XtextValidationTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    with(XtextStandaloneSetup.class);
    EValidator.Registry.INSTANCE.put(EcorePackage.eINSTANCE, EcoreValidator.INSTANCE);
        File tempFile = File.createTempFile("XtextValidationTest", ".ecore");
        tempFile.deleteOnExit();
        Files.write("<?xml version='1.0' encoding='UTF-8'?>" +
                "<ecore:EPackage xmi:version='2.0' xmlns:xmi='http://www.omg.org/XMI'"+
                "                xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+
                "                xmlns:ecore='http://www.eclipse.org/emf/2002/Ecore'"+
                "                name='XtextValidationBugs'"+
                "                nsURI='http://XtextValidationBugs'"+
                "                nsPrefix='XtextValidationBugs'>"+
                "  <eClassifiers xsi:type='ecore:EClass' name='Bug322875'>"+
                "    <eStructuralFeatures xsi:type='ecore:EReference' name='referencesETypeFromClasspathPackage' eType='ecore:EClass classpath:/org/eclipse/xtext/Xtext.ecore#//Grammar'/>"+
                "  </eClassifiers>"+
                "</ecore:EPackage>"
                , tempFile, StandardCharsets.UTF_8);
        xtextValidationTest_ecore = tempFile.toURI().toURL();
}
项目:emfjson-samples    文件:ModelEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        ModelEditorPlugin.INSTANCE.log(exception);
    }
}
项目:Source    文件:MarkerToEObjectLocationDescriptor.java   
/**
 * {@inheritDoc}
 *
 * @see org.eclipse.mylyn.docs.intent.mapping.ide.adapter.IMarkerToLocationDescriptor#getAdapter(org.eclipse.core.resources.IMarker)
 */
public ILocationDescriptor getAdapter(IMarker marker) {
    ILocationDescriptor res = null;

    try {
        if (marker.isSubtypeOf(EValidator.MARKER)) {
            final String uri = (String)marker.getAttribute(IEObjectLocationMaker.URI_ATTRIBUTE);
            // TODO we should change this to use a global ResourceSet...
            final ResourceSet rs = new ResourceSetImpl();
            final EObject eObject = rs.getEObject(URI.createURI(uri), true);
            res = IdeMappingUtils.adapt(eObject, ILocationDescriptor.class);
        }
    } catch (CoreException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(),
                e));
    }

    return res;
}
项目:menthor-xcore    文件:OntoumlDiagnostician.java   
public static List<Diagnostic> execute(Model model){
    OCLstdlibStandaloneSetup.doSetup();
    EssentialOCLStandaloneSetup.doSetup();
    CompleteOCLStandaloneSetup.doSetup();
    OCLstdlib.install();                
    OCL ocl = OCL.newInstance();
    List<String> oclFilePaths = new ArrayList<String>();
    oclFilePaths.add("model/ontouml.ocl");
    if(checkTypes) oclFilePaths.add("model/types.ocl");
    if(checkRelationships) oclFilePaths.add("model/relationships.ocl");
    if(checkMetaAttributes) oclFilePaths.add("model/metaattributes.ocl");
    if(checkBinaryProperties) oclFilePaths.add("model/binproperties.ocl");
    if(checkDependencies) oclFilePaths.add("model/dependency.ocl");
    if(checkCardinalities) oclFilePaths.add("model/cardinalities.ocl");             
    ComposedEValidator composed = ComposedEValidator.install(OntoumlPackage.eINSTANCE);
    for(String oclPath: oclFilePaths){
        File file = new File(oclPath);
        URI oclURI = URI.createFileURI(file.getAbsolutePath());         
        CompleteOCLEObjectValidator myValidator = new CompleteOCLEObjectValidator(OntoumlPackage.eINSTANCE, oclURI, ocl.getEnvironmentFactory());
        EValidator.Registry.INSTANCE.put(OntoumlPackage.eINSTANCE, myValidator);
        composed.addChild(myValidator);
    }                       
    Diagnostic diagnostics = Diagnostician.INSTANCE.validate(model);            
    return diagnostics.getChildren();
}
项目:SecureBPMN    文件:Securebpmn2Editor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(
                    EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet()
                        .getEObject(uri, true);
                if (eObject != null) {
                    setSelectionToViewer(Collections
                            .singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    } catch (CoreException exception) {
        bpmn2EditorPlugin.INSTANCE.log(exception);
    }
}
项目:SecureBPMN    文件:DiEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(
                    EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet()
                        .getEObject(uri, true);
                if (eObject != null) {
                    setSelectionToViewer(Collections
                            .singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    } catch (CoreException exception) {
        bpmn2EditorPlugin.INSTANCE.log(exception);
    }
}
项目:SecureBPMN    文件:DcEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(
                    EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet()
                        .getEObject(uri, true);
                if (eObject != null) {
                    setSelectionToViewer(Collections
                            .singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    } catch (CoreException exception) {
        bpmn2EditorPlugin.INSTANCE.log(exception);
    }
}
项目:SecureBPMN    文件:BpmnDiEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(
                    EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet()
                        .getEObject(uri, true);
                if (eObject != null) {
                    setSelectionToViewer(Collections
                            .singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    } catch (CoreException exception) {
        bpmn2EditorPlugin.INSTANCE.log(exception);
    }
}
项目:SecureBPMN    文件:Bpmn2Editor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(
                    EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet()
                        .getEObject(uri, true);
                if (eObject != null) {
                    setSelectionToViewer(Collections
                            .singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    } catch (CoreException exception) {
        bpmn2EditorPlugin.INSTANCE.log(exception);
    }
}
项目:ModelDebugging    文件:DSLBreakpoint.java   
/**
 * Sets attributes for the given {@link IMarker}.
 * 
 * @param marker
 *            the {@link IMarker}
 * @param resource
 *            the {@link IFile} containing the mode
 * @param instruction
 *            the {@link EObject} representing the instruction
 * @param persistent
 *            should be persisted
 * @throws CoreException
 *             if attributes can't be set
 */
protected void setMarkerAttibutes(final IMarker marker, IFile resource, EObject instruction,
        boolean persistent) throws CoreException {
    final IItemLabelProvider provider = (IItemLabelProvider)ADAPTER_FACTORY.adapt(instruction,
            IItemLabelProvider.class);
    marker.setAttribute(IBreakpoint.ENABLED, true);
    marker.setAttribute(IBreakpoint.PERSISTED, persistent);
    marker.setAttribute(IBreakpoint.ID, getModelIdentifier());
    marker.setAttribute(EValidator.URI_ATTRIBUTE, EcoreUtil.getURI(instruction).toString());
    final String instructionText = provider.getText(instruction);
    marker.setAttribute(IMarker.MESSAGE, "DSL Breakpoint: " + resource.getFullPath() + " ["
            + instructionText + "]");
    try {
        marker.setAttribute(IMAGE_ATTRIBUTE, toAttribute(provider.getImage(instruction)));
    } catch (IOException e) {
        Activator.getDefault().error(e);
    }
    marker.setAttribute(TEXT_ATTRIBUTE, instructionText);
}
项目:ModelDebugging    文件:SiriusEditorUtils.java   
/**
 * Show the given {@link EObject instruction}.
 * 
 * @param editorPart
 *            the opened {@link DialectEditor}
 * @param instruction
 *            the {@link EObject instruction} to show
 */
public static void showInstruction(DialectEditor editorPart, EObject instruction) {
    final URI resourceURI = instruction.eResource().getURI();
    if (resourceURI.isPlatformResource()) {
        final String resourcePath = resourceURI.toPlatformString(true);
        final IResource resource = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(
                resourcePath));
        try {
            final IMarker marker = resource.createMarker(EValidator.MARKER);
            marker.setAttribute(EValidator.URI_ATTRIBUTE, EcoreUtil.getURI(instruction).toString());
            final TraceabilityMarkerNavigationProvider navigationProvider = new TraceabilityMarkerNavigationProvider(
                    (DialectEditor)editorPart);
            navigationProvider.gotoMarker(marker);
            marker.delete();
        } catch (CoreException e) {
            DebugSiriusIdeUiPlugin.INSTANCE.log(e);
        }
    }
}
项目:collaboro    文件:NotationEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        NotationEditorPlugin.INSTANCE.log(exception);
    }
}
项目:collaboro    文件:HistoryEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        HistoryEditorPlugin.INSTANCE.log(exception);
    }
}
项目:collaboro    文件:HistoryEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        HistoryEditorPlugin.INSTANCE.log(exception);
    }
}
项目:collaboro    文件:NotationEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        NotationEditorPlugin.INSTANCE.log(exception);
    }
}
项目:emfstore-rest    文件:ConfigEditor.java   
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(
                EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet()
                    .getEObject(uri, true);
                if (eObject != null) {
                    setSelectionToViewer(Collections
                        .singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    } catch (CoreException exception) {
        ConfigEditorPlugin.INSTANCE.log(exception);
    }
}
项目:psd-ui-generator    文件:Validator.java   
public void validate(View model) {

        // initialize OCL
        org.eclipse.ocl.examples.pivot.OCL.initialize(null);

        String oclDelegateURI = OCLDelegateDomain.OCL_DELEGATE_URI_PIVOT;
        EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
            new OCLInvocationDelegateFactory.Global());
        EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
            new OCLSettingDelegateFactory.Global());
        EValidator.ValidationDelegate.Registry.INSTANCE.put(oclDelegateURI,
            new OCLValidationDelegateFactory.Global());

        OCLinEcoreStandaloneSetup.doSetup();
        // install the OCL standard library
        OCLstdlib.install();

        // do diagnostic
        diag = Diagnostician.INSTANCE.validate(model);
        modelname = model.getID();
    }
项目:eclipse-avro    文件:Diagnostician.java   
public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context)
{
  Object eValidator;
  EClass eType = eClass;
  while ((eValidator = eValidatorRegistry.get(eType.eContainer())) == null)
  {
    List<EClass> eSuperTypes = eType.getESuperTypes();
    if (eSuperTypes.isEmpty())
    {
      eValidator = eValidatorRegistry.get(null);
      break;
    }
    else
    {
      eType = eSuperTypes.get(0);
    }
  }
  boolean circular = context.get(EObjectValidator.ROOT_OBJECT) == eObject;
  boolean result = doValidate((EValidator)eValidator, eClass, eObject, diagnostics, context);
  if ((result || diagnostics != null) && !circular)
  {
    result &= doValidateContents(eObject, diagnostics, context);
  }
  return result;
}
项目:eclipse-avro    文件:ValidationDelegateRegistryImpl.java   
@Override
public Object get(Object key)
{
  Object validationDelegate = super.get(key);
  if (validationDelegate instanceof EValidator.ValidationDelegate.Descriptor)
  {
    EValidator.ValidationDelegate.Descriptor validationDelegateDescriptor = (EValidator.ValidationDelegate.Descriptor)validationDelegate;
    validationDelegate = validationDelegateDescriptor.getValidationDelegate();
    put((String)key, validationDelegate);
    return validationDelegate;
  }
  else if (validationDelegate != null)
  {
    return validationDelegate;
  }
  else
  {
    return delegatedGet(key);
  }
}
项目:eclipse-avro    文件:EValidatorRegistryImpl.java   
@Override
public Object get(Object key)
{
  Object eValidator = super.get(key);
  if (eValidator instanceof EValidator.Descriptor)
  {
    EValidator.Descriptor eValidatorDescriptor = (EValidator.Descriptor)eValidator;
    eValidator = eValidatorDescriptor.getEValidator();
    put((EPackage)key, eValidator);
    return eValidator;
  }
  else if (eValidator != null)
  {
    return eValidator;
  }
  else
  {
    return delegatedGet(key);
  }
}
项目:citygml4emf    文件:XALEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:XlinkEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:NamespaceEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:Smil20Editor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:LanguageEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:CityfurnitureEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:GenericsEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:TexturedsurfaceEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:CityobjectgroupEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:CitygmlEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}
项目:citygml4emf    文件:TransportationEditor.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void gotoMarker(IMarker marker) {
    try {
        if (marker.getType().equals(EValidator.MARKER)) {
            String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
            if (uriAttribute != null) {
                URI uri = URI.createURI(uriAttribute);
                EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
                if (eObject != null) {
                  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
                }
            }
        }
    }
    catch (CoreException exception) {
        CityGMLEditorPlugin.INSTANCE.log(exception);
    }
}