Examples of MatchingResult


Examples of graphmatcher.matcher.MatchingResult

        Graph template = _inputPanel.getTemplateGraph();

        String matcherID = optionPanel.getSelectedMatcherID();
        AbstractMatcher matcher = MatcherFactory.createMatcher(matcherID, pattern, template);
        MatchingResult matchingResult = matcher.match(optionPanel.getMatchingOptions());
        _matchingPanel.setOptions(_guiOptionPanel.showMatchingEdges(), _guiOptionPanel.showIndices(),
            _guiOptionPanel.showTransformedPattern());
        _matchingPanel.setMatchingResult(matchingResult);
        resultPanel.setMatchingResult(matchingResult);
      }
View Full Code Here

Examples of graphmatcher.matcher.MatchingResult

            template);
        Runnable matchingTask = new Runnable() {
          @Override
          public void run() {
            try {
              MatchingResult matchingResult = matcher.match(options);
              matchingResults[currentJ] = matchingResult;

              synchronized (progressBar) {
                progressBar.setValue(progressBar.getValue() + 1);
              }
View Full Code Here

Examples of graphmatcher.matcher.MatchingResult

    }
    if (value instanceof String) {
      String graphName = (String) value;
      return new JLabel(graphName);
    }
    MatchingResult matchingResult = (MatchingResult) value;
    String matchedGraphName = matchingResult.getTemplate().toString();
    JLabel result = new JLabel(matchedGraphName);
    result.setToolTipText("Abstand: " + (1 - matchingResult.getQuality()));
    if (column > 0 && matchedGraphName != null) {
      result.setOpaque(true);
      String graphName = (String) table.getModel().getValueAt(row, 0);
      Color color;
      if (graphName.substring(0, 4).equals(matchedGraphName.substring(0, 4))) {
View Full Code Here

Examples of graphmatcher.matcher.MatchingResult

        int row = table.getSelectedRow();
        Object value = model.getValueAt(row, column);
        if (!(value instanceof MatchingResult)) {
          return;
        }
        MatchingResult result = (MatchingResult) value;
        if (dialog != null) {
          dialog.dispose();
        }
        dialog = new JDialog();
        dialog.setLocation(GraphMatcherTester.this.getX() + GraphMatcherTester.this.getWidth(), 0);
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.util.MatchingResult

            excHandler.noResourceMethodForAccMediaTypes(supporting);
        }
        // (b) and (c)
        ResourceMethod bestResourceMethod = getBestMethod(resourceMethods,
                givenMediaType, accMediaTypes, httpMethod);
        MatchingResult mr = bestResourceMethod.getPathRegExp().match(u);
        addPathVarsToMap(mr, callContext);
        String matchedUriPart = mr.getMatched();
        if (matchedUriPart.length() > 0) {
            Object jaxRsResObj = resObj.getJaxRsResourceObject();
            callContext.addForMatched(jaxRsResObj, matchedUriPart);
        }
        return new ResObjAndMeth(resObj, bestResourceMethod);
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.util.MatchingResult

        for (RootResourceClass rootResourceClass : this.resourceClasses.roots()) {
            // Map.Entry<UriTemplateRegExp, Class> eAndC = eAndCIter.next();
            // UriTemplateRegExp regExp = eAndC.getKey();
            // Class clazz = eAndC.getValue();
            PathRegExp rrcPathRegExp = rootResourceClass.getPathRegExp();
            MatchingResult matchingResult = rrcPathRegExp.match(u);
            if (matchingResult == null)
                continue; // doesn't match
            if (matchingResult.getFinalCapturingGroup().isEmptyOrSlash())
                eAndCs.add(rootResourceClass);
            else if (rootResourceClass.hasSubResourceMethodsOrLocators())
                eAndCs.add(rootResourceClass);
        }
        // (d)
        if (eAndCs.isEmpty())
            excHandler.rootResourceNotFound();
        // (e) and (f)
        RootResourceClass tClass = getFirstByNoOfLiteralCharsNoOfCapturingGroups(eAndCs);
        // (f)
        PathRegExp rMatch = tClass.getPathRegExp();
        MatchingResult matchResult = rMatch.match(u);
        u = matchResult.getFinalCapturingGroup();
        addPathVarsToMap(matchResult, tlContext.get());
        ResourceObject o = instantiateRrc(tClass);
        return new RroRemPathAndMatchedPath(o, u, matchResult.getMatched());
    }
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.util.MatchingResult

            // (c) and (d) Filter E: remove members do not match U or final
            // match not empty
            for (ResourceMethodOrLocator methodOrLocator : resClass
                    .getResourceMethodsAndLocators()) {
                PathRegExp pathRegExp = methodOrLocator.getPathRegExp();
                MatchingResult matchingResult = pathRegExp.match(u);
                if (matchingResult == null)
                    continue;
                if (matchingResult.getFinalCapturingGroup().isEmptyOrSlash())
                    eWithMethod.add(methodOrLocator);
                // the following is added by Stephan (is not in spec 2008-03-06)
                else if (methodOrLocator instanceof SubResourceLocator)
                    eWithMethod.add(methodOrLocator);
            }
            // (e) If E is empty -> HTTP 404
            if (eWithMethod.isEmpty())
                excHandler.resourceNotFound();// NICE (o.getClass(), u);
            // (f) and (g) sort E, use first member of E
            ResourceMethodOrLocator firstMeth = getFirstByNoOfLiteralCharsNoOfCapturingGroups(eWithMethod);

            PathRegExp rMatch = firstMeth.getPathRegExp();
            MatchingResult matchingResult = rMatch.match(u);

            addPathVarsToMap(matchingResult, callContext);

            // (h) When Method is resource method
            if (firstMeth instanceof ResourceMethod)
                return new ResObjAndRemPath(o, u);
            String matchedUriPart = matchingResult.getMatched();
            Object jaxRsResObj = o.getJaxRsResourceObject();
            callContext.addForMatched(jaxRsResObj, matchedUriPart);

            // (g) and (i)
            u = matchingResult.getFinalCapturingGroup();
            SubResourceLocator subResourceLocator = (SubResourceLocator) firstMeth;
            o = createSubResource(o, subResourceLocator, callContext);
            resClass = o.getResourceClass();
            // (j) Go to step 2a (repeat for)
        }
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.util.MatchingResult

    /**
     * Test method for
     * {@link org.restlet.ext.jaxrs.internal.util.PathRegExp#match(java.lang.String)} .
     */
    public void testMatchM1() {
        MatchingResult matchingResult = this.regExpMultipleSegments1
                .match(VALID_PATH_1_RP);
        assertNotNull(matchingResult);
        assertEquals("25478", matchingResult.getVariables().get(ID1));
        assertEquals("12345", matchingResult.getVariables().get(ID2));
        assertEquals(new RemainingPath(""), matchingResult
                .getFinalCapturingGroup());

        matchingResult = this.regExpMultipleSegments1.match(VALID_PATH_2_RP);
        assertNotNull(matchingResult);
        assertEquals("25478", matchingResult.getVariables().get(ID1));
        assertEquals("12345", matchingResult.getVariables().get(ID2));
        assertEquals(new RemainingPath(""), matchingResult
                .getFinalCapturingGroup());
    }
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.util.MatchingResult

    /**
     * Test method for
     * {@link org.restlet.ext.jaxrs.internal.util.PathRegExp#match(java.lang.String)} .
     */
    public void testMatchM2() {
        MatchingResult matchingResult = this.regExpMultipleSegments2
                .match(VALID_PATH_1_RP);
        assertNotNull(matchingResult);
        assertEquals("25478", matchingResult.getVariables().get(ID1));
        assertEquals("12345", matchingResult.getVariables().get(ID2));

        matchingResult = this.regExpMultipleSegments2.match(VALID_PATH_2_RP);
        assertNotNull(matchingResult);
        assertEquals("25478", matchingResult.getVariables().get(ID1));
        assertEquals("12345", matchingResult.getVariables().get(ID2));
        assertEquals(new RemainingPath(""), matchingResult
                .getFinalCapturingGroup());
    }
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.util.MatchingResult

    /**
     * Test method for
     * {@link org.restlet.ext.jaxrs.internal.util.PathRegExp#match(java.lang.String)} .
     */
    public void testMatchO1() {
        final MatchingResult matchingResult = this.regExpOneSegment1
                .match(VALID_PATH_1_RP);
        assertNotNull(matchingResult);
        assertEquals("25478", matchingResult.getVariables().get(ID1));
        assertEquals("12345", matchingResult.getVariables().get(ID2));
        assertEquals(new RemainingPath(""), matchingResult
                .getFinalCapturingGroup());

        this.regExpOneSegment1.match(VALID_PATH_2_RP);
        assertNotNull(matchingResult);
        assertEquals("25478", matchingResult.getVariables().get(ID1));
        assertEquals("12345", matchingResult.getVariables().get(ID2));
        assertEquals(new RemainingPath(""), matchingResult
                .getFinalCapturingGroup());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.