Package org.wikipediacleaner.api.data

Examples of org.wikipediacleaner.api.data.PageElementTag$Parameter


                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here


            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
                buffer.append(parameter.getName());
                commaNeeded = true;
            }
        }
        return buffer.toString();
    }
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
View Full Code Here

            arguments,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    Parameter p = (Parameter)object;
                    return !p.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL) && !p.isException();
                }
            });
        return arguments;
    }
View Full Code Here

          Page.areSameTitle(pageTitle, linkedPage.getRedirectTitle())) {
        if (errors == null) {
          return true;
        }
        result = true;
        PageElementTag tagImagemap = analysis.getSurroundingTag(
            PageElementTag.TAG_WIKI_IMAGEMAP, link.getBeginIndex());
        if (tagImagemap != null) {
          int previousCR = getPreviousCR(contents, link.getBeginIndex());
          int nextCR = getNextCR(contents, link.getEndIndex());
          nextCR = Math.min(nextCR, tagImagemap.getMatchingTag().getBeginIndex());
          CheckErrorResult errorResult = createCheckErrorResult(
              analysis, previousCR, nextCR);
          if ((previousCR > tagImagemap.getEndIndex()) &&
              (contents.charAt(nextCR) == '\n')) {
            errorResult.addReplacement("", GT._("Delete"));
          }
          errors.add(errorResult);
        } else {
View Full Code Here

          (contents.charAt(beginIndex) == '[')) {

        // Compute maximum index for link end
        int linkEndIndex = link.getEndIndex();
        int maxEnd = maxLength;
        PageElementTag refTag = analysis.getSurroundingTag(PageElementTag.TAG_WIKI_REF, linkBeginIndex);
        if ((refTag != null) &&
            (refTag.getMatchingTag() != null) &&
            (refTag.getMatchingTag().getBeginIndex() >= linkEndIndex)) {
          maxEnd = refTag.getMatchingTag().getBeginIndex();
        }

        // Search for possible end
        boolean searchDone = false;
        int possibleEnd = -1;
View Full Code Here

    // Analyze each <small> tag
    boolean result = false;
    List<PageElementTag> smallTags = analysis.getTags(PageElementTag.TAG_HTML_SMALL);
    for (PageElementTag smallTag : smallTags) {
      int index = smallTag.getBeginIndex();
      PageElementTag refTag = analysis.getSurroundingTag(PageElementTag.TAG_WIKI_REF, index);
      PageElementTag subTag = analysis.getSurroundingTag(PageElementTag.TAG_HTML_SUB, index);
      PageElementTag supTag = analysis.getSurroundingTag(PageElementTag.TAG_HTML_SUP, index);
      if ((refTag != null) || (subTag != null) || (supTag != null)) {
        if (errors == null) {
          return true;
        }
        result = true;
View Full Code Here

              endError = currentIndex;
            }
            currentIndex--;
          }
          if (contents.charAt(currentIndex) == '>') {
            PageElementTag tag = analysis.isInTag(currentIndex);
            if (tag != null) {
              String name = tag.getNormalizedName();
              if (PageElementTag.TAG_HTML_BR.equals(name)) {
                breakFound = true;
                shouldStop = false;
                beginError = tag.getBeginIndex();
                currentIndex = beginError - 1;
              } else if (!breakFound) {
                /*if (PageElementTag.TAG_WIKI_MATH.equals(name)) {
                  tagAfter = true;
                  shouldStop = false;
View Full Code Here

    boolean result = false;
    int index = 0;
    while (index < galleryTags.size()) {

      // Check for error
      PageElementTag galleryTag = galleryTags.get(index);
      boolean found = false;
      if (galleryTag.isFullTag() || !galleryTag.isComplete()) {
        found = true;
      }
      int beginIndex = galleryTag.getBeginIndex();
      if (found) {
        if (analysis.getSurroundingTag(PageElementTag.TAG_WIKI_NOWIKI, beginIndex) != null) {
          found = false;
        }
      }

      if (found) {
        if (errors == null) {
          return true;
        }
        result = true;

        // Check if an other <gallery> tag is just after and can be used
        PageElementTag nextTag = null;
        if (!galleryTag.isEndTag() && (index + 1 < galleryTags.size())) {
          nextTag = galleryTags.get(index + 1);
          int currentIndex = galleryTag.getEndIndex();
          while ((nextTag != null) && (currentIndex < nextTag.getBeginIndex())) {
            char currentChar = contents.charAt(currentIndex);
            if ((currentChar != ' ') && (currentChar != '\n')) {
              nextTag = null;
            }
            currentIndex++;
          }
          if (nextTag != null) {
            if ((galleryTag.getParametersCount() > 0) &&
                (nextTag.getParametersCount() > 0)) {
              nextTag = null;
            }
          }
        }

        // Report error
        int endIndex = (nextTag != null) ? nextTag.getEndIndex() : galleryTag.getEndIndex();
        CheckErrorResult errorResult = createCheckErrorResult(
            analysis, beginIndex, endIndex);
        if (nextTag == null) {
          errorResult.addReplacement("");
          index++;
        } else if (nextTag.getParametersCount() == 0) {
          errorResult.addReplacement(contents.substring(
              galleryTag.getBeginIndex(), galleryTag.getEndIndex()));
          errorResult.addReplacement(contents.substring(
              nextTag.getBeginIndex(), nextTag.getEndIndex()));
          index += 2;
        } else {
          errorResult.addReplacement(contents.substring(
              nextTag.getBeginIndex(), nextTag.getEndIndex()));
          errorResult.addReplacement(contents.substring(
              galleryTag.getBeginIndex(), galleryTag.getEndIndex()));
          index += 2;
        }
        errors.add(errorResult);
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.data.PageElementTag$Parameter

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.