Package com.volantis.mcs.model.path

Examples of com.volantis.mcs.model.path.Path


        }
        if (identifier == null) {
            throw new IllegalArgumentException("identifier cannot be null");
        }

        Path path = context.getCurrentPath();

        Definition definition = (Definition) definitions.get(identifier);
        if (definition == null) {
            definition = new Definition(source, path);
            definitions.put(identifier, definition);
        } else if (definition.getPath().getAsString().equals(path.getAsString())) {
            // Redefining the same object twice so just ignore it.
        } else {
            // Duplicate definitions found. If the definition is not already
            // marked as duplicated then mark it and report it as a duplicate.
            if (!definition.isDuplicated()) {
                SourceLocation firstSource = definition.getSource();
                Path firstPath = definition.getPath();

                reportDuplicate(context, firstSource, firstPath, identifier);
                definition.setDuplicated(true);
            }
View Full Code Here


        // using the Path provided by model-based validation.
        try {
            Object pathString = marker.getAttribute(
                    ResourceDiagnosticsAdapter.DIAGNOSTIC_PATH_KEY);
            if (pathString instanceof String) {
                Path path = ModelFactory.getDefaultInstance().parsePath(
                        (String) pathString);
                setFocus(path);
            }
        } catch (CoreException ce) {
            // Could not retrieve the location of the marker
View Full Code Here

    public void gotoMarker(IMarker iMarker) {
        try {
            Object pathString = iMarker.getAttribute(
                    ResourceDiagnosticsAdapter.DIAGNOSTIC_PATH_KEY);
            if (pathString instanceof String) {
                Path path = ModelFactory.getDefaultInstance().parsePath(
                        (String) pathString);
                setFocus(path);
            }
        } catch (CoreException ce) {
            // Could not retrieve the location of the marker
View Full Code Here

    public void gotoMarker(IMarker iMarker) {
        try {
            Object pathString = iMarker.getAttribute(
                    ResourceDiagnosticsAdapter.DIAGNOSTIC_PATH_KEY);
            if (pathString instanceof String) {
                Path path = ModelFactory.getDefaultInstance().parsePath(
                        (String) pathString);
                setFocus(path);
            }
        } catch (CoreException ce) {
            // Could not retrieve the location of the marker
View Full Code Here

        contactsList.add(fred);
        contactsList.add(wilma);

        Proxy proxy = createProxy(contacts);

        Path path2Fred = modelFactory.parsePath("/contacts/0/address");
        Proxy fredAddress = proxy.getProxy(path2Fred);

        Path path2Wilma = modelFactory.parsePath("/contacts/1/address");
        Proxy wilmaAddress = proxy.getProxy(path2Wilma);

        // Build up a mapping from the model object to the proxies.
        Prepare4Validation prepare = new Prepare4Validation();
        prepare.prepare(proxy);
View Full Code Here

    private void checkPath(
            Proxy root, Proxy proxy,
            final String expectedPathAsString,
            List expectedProxies) {

        Path path;
        String pathAsString;
        path = proxy.getPathFromRoot();
        pathAsString = path.getAsString();
        assertEquals(expectedPathAsString, pathAsString);
        assertSame("Proxies match", proxy, root.getProxy(path));

        List actualProxies = root.getProxies(path);
        assertEquals("Proxy list", expectedProxies, actualProxies);
View Full Code Here

        // Get the diagnostics and iterate over them associating them with
        // the relevant proxy.
        List diagnostics = validator.getDiagnostics();
        for (int i = 0; i < diagnostics.size(); i++) {
            Diagnostic diagnostic = (Diagnostic) diagnostics.get(i);
            Path path = diagnostic.getPath();
            InternalProxy internalProxy = (InternalProxy)
                    proxy.getEnclosingProxy(path);
            if (internalProxy == null) {
                // System.out.println("Unknown path: " + path.getAsString());
            } else {
View Full Code Here

     * @return The model object.
     */
    protected abstract Object copyModelObjectImpl();

    public String getPathAsString() {
        Path path = getPathFromRoot();
        return path.getAsString();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.model.path.Path

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.