Package com.volantis.mcs.eclipse.ab.editors.dom.validation

Examples of com.volantis.mcs.eclipse.ab.editors.dom.validation.MarkerGeneratingErrorReporter


                getDeviceIdentificationDocument().getRootElement();

        try {
            context.addRootElement(identificationRootElement,
                    identificationRootElement.getName());
            MarkerGeneratingErrorReporter errorReporter =
                    context.getErrorReporter(identificationRootElement);

            LocationDetailsRegistry registry =
                    errorReporter.getLocationDetailsRegistry();
            if (registry == null) {
                registry = new LocationDetailsRegistry();
                errorReporter.setLocationDetailsRegistry(registry);
            }

            DefaultJDOMFactory factory = new DefaultJDOMFactory();

            Element element = factory.element(DeviceRepositorySchemaConstants.
View Full Code Here


        // marker as the IMarker#setAttribute(String, Object) method only
        // allows Integer, Boolean and String instances as its Object
        // argument. We work around this by getting the
        // MarkerGeneratingErrorReporter class to manage a map of
        // XPath string to XPath object mappings.
        MarkerGeneratingErrorReporter errorReporter =
                context.getErrorReporter();

        if (errorReporter == null) {
            // this should never happen
            throw new IllegalStateException("DOMValidator is null");
        }

        // get the XPath for the marker
        XPath xPath = errorReporter.getXPath(marker);

        // We don't need to do anything with a null XPath since means
        // we cannot set the focus. For example, the policy name (file name
        // is invalid => there is no editor for file names and no way
        // to set the focus).
View Full Code Here

                    (ODOMElement) hierarchyDocument.getRootElement();

            context.addRootElement(hierarchyRootElement,
                    DeviceRepositorySchemaConstants.HIERARCHY_ELEMENT_NAME);

            MarkerGeneratingErrorReporter errorReporter =
                    context.getErrorReporter(hierarchyRootElement);

            LocationDetailsRegistry registry =
                    errorReporter.getLocationDetailsRegistry();
            if (registry == null) {
                registry = new LocationDetailsRegistry();
                errorReporter.setLocationDetailsRegistry(registry);
            }

            DefaultJDOMFactory factory = new DefaultJDOMFactory();

            Element element = factory.element(DeviceRepositorySchemaConstants.
View Full Code Here

                                 String rootElementIdentifier)
                throws SAXException, ParserErrorException {

            this.rootElement = rootElement;

            errorReporter = new MarkerGeneratingErrorReporter(policyResource,
                    rootElement, rootElementIdentifier);

            domValidator =
                    createDOMValidator(errorReporter);
View Full Code Here

                getDeviceIdentificationDocument().getRootElement();

        try {
            context.addRootElement(identificationRootElement,
                    identificationRootElement.getName());
            MarkerGeneratingErrorReporter errorReporter =
                    context.getErrorReporter(identificationRootElement);
            LocationDetailsRegistry registry =
                    errorReporter.getLocationDetailsRegistry();
            if (registry == null) {
                registry = new LocationDetailsRegistry();
                errorReporter.setLocationDetailsRegistry(registry);
            }

            DefaultJDOMFactory factory = new DefaultJDOMFactory();

            Element element = factory.element(DeviceRepositorySchemaConstants.
View Full Code Here

                    final Element node = obtainRootElement(resource);
                    if (node != null) {
                        // Create a builder and error reporter to validate the
                        // policy itself.
                        final MarkerGeneratingErrorReporter errorReporter =
                                new MarkerGeneratingErrorReporter(resource,
                                        node, null);
                        // create a validator
                        XercesBasedDOMValidator validator =
                                createDOMValidator(errorReporter);
View Full Code Here

            // Censor xsd generated errors on the number element
            // of the TAC document since the error messages bear no relation
            // to what is shown in the gui.
            // todo remove this when validation is updated to provide good error messages.
            MarkerGeneratingErrorReporter errorReporter =
                    context.getErrorReporter((ODOMElement) context.
                    getDeviceRepositoryAccessorManager().
                    getDeviceTACIdentificationDocument().getRootElement());

            errorReporter.censor(DeviceRepositorySchemaConstants.
                    DEVICE_ELEMENT_NAME +
                    ":" + DeviceRepositorySchemaConstants.NUMBER_ELEMENT_NAME,
                    FaultTypes.INVALID_SCHEMA_PATTERN_VALUE);

            errorReporter.censor(DeviceRepositorySchemaConstants.
                    DEVICE_ELEMENT_NAME +
                    ":" + DeviceRepositorySchemaConstants.NUMBER_ELEMENT_NAME,
                    FaultTypes.INVALID_ELEMENT_CONTENT);

            errorReporter.putMessageKeyMapping(INVALID_TAC_NUMBER,
                    MarkerGeneratingErrorReporter.MESSAGE_KEY_PREFIX +
                    "invalidTACNumber");

            context.addRootElement(identificationRootElement,
                    identificationRootElement.getName());

            LocationDetailsRegistry registry =
                    errorReporter.getLocationDetailsRegistry();
            if (registry == null) {
                registry = new LocationDetailsRegistry();
                errorReporter.setLocationDetailsRegistry(registry);
            }

            DefaultJDOMFactory factory = new DefaultJDOMFactory();

            Element element = factory.element(DeviceRepositorySchemaConstants.
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.ab.editors.dom.validation.MarkerGeneratingErrorReporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.