Package com.google.gdata.util

Examples of com.google.gdata.util.ParseException


    }
    if (!contentConsumed && content != null && content.length() != 0) {
      message.append("Unexpected text content ");
    }
    if (message.length() != 0) {
      throw new ParseException(message.toString());
    }
  }
View Full Code Here


      @Override
      public void processEndElement() throws ParseException {

        if (feedState.totalResults != Query.UNDEFINED) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateTotalResults);
        }

        if (value == null) {
          throw new ParseException(
              CoreErrorDomain.ERR.logoValueRequired);
        }

        try {
          feedState.totalResults = Integer.valueOf(value).intValue();
        } catch (NumberFormatException e) {
          throw new ParseException(
              CoreErrorDomain.ERR.totalResultsNotInteger);
        }
      }
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (feedState.startIndex != Query.UNDEFINED) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateStartIndex);
        }

        if (value == null) {
          throw new ParseException(
              CoreErrorDomain.ERR.logoValueRequired);
        }

        try {
          feedState.startIndex = Integer.valueOf(value).intValue();
        } catch (NumberFormatException e) {
          throw new ParseException(
              CoreErrorDomain.ERR.startIndexNotInteger);
        }
      }
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (feedState.itemsPerPage != Query.UNDEFINED) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateItemsPerPage);
        }

        if (value == null) {
          throw new ParseException(
              CoreErrorDomain.ERR.logoValueRequired);
        }

        try {
          feedState.itemsPerPage = Integer.valueOf(value).intValue();
        } catch (NumberFormatException e) {
          throw new ParseException(
              CoreErrorDomain.ERR.itemsPerPageNotInteger);
        }
      }
View Full Code Here

  protected static <T extends Extension> T createExtensionInstance(
      Class<T> extClass) throws ParseException {
    try {
      return extClass.newInstance();
    } catch (InstantiationException e) {
      throw new ParseException(
          CoreErrorDomain.ERR.cantCreateExtension, e);
    } catch (IllegalAccessException e) {
      throw new ParseException(
          CoreErrorDomain.ERR.cantCreateExtension, e);
    }
  }
View Full Code Here

      if (extDescription.isRepeatable()) {
        addRepeatingExtension(extension, extClass);
      } else {
        boolean added = addExtension(extension, extClass);
        if (!added) {
          ParseException pe = new ParseException(
              CoreErrorDomain.ERR.duplicateExtension);
          pe.setInternalReason("Duplicate extension element " +
              namespaceUri + ":" + localName);
          throw pe;
        }
      }
    }
View Full Code Here

        boolean found =
            (extDescription.isRepeatable() ? repeatingExtensionMap
                .containsKey(extClass) : nonRepeatingExtensionMap
                .containsKey(extClass));
        if (!found) {
          ParseException pe = new ParseException(
              CoreErrorDomain.ERR.missingExtensionElement);
          pe.setInternalReason("Required extension element " +
              extDescription.getNamespace().getUri() + ":" +
              extDescription.getLocalName() + " not found.");
          throw pe;
        }
      }
View Full Code Here

          TextConstruct.ChildHandlerInfo chi =
            TextConstruct.getChildHandler(attrs);

          if (state.title != null) {
            throw new ParseException(
                CoreErrorDomain.ERR.duplicateTitle);
          }

          state.title = chi.textConstruct;
          return chi.handler;

        } else if (localName.equals("summary")) {

          TextConstruct.ChildHandlerInfo chi =
            TextConstruct.getChildHandler(attrs);

          if (state.summary != null) {
            throw new ParseException(
                CoreErrorDomain.ERR.duplicateSummary);
          }

          state.summary = chi.textConstruct;
          return chi.handler;

        } else if (localName.equals("rights")) {

          TextConstruct.ChildHandlerInfo chi =
            TextConstruct.getChildHandler(attrs);

          if (state.rights != null) {
            throw new ParseException(
                CoreErrorDomain.ERR.duplicateRights);
          }

          state.rights = chi.textConstruct;
          return chi.handler;

        } else if (localName.equals("content")) {

          if (state.content != null) {
            throw new ParseException(
                CoreErrorDomain.ERR.duplicateContent);
          }

          Content.ChildHandlerInfo chi =
              getContentHandlerInfo(extProfile, attrs);
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (state.id != null) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateEntryId);
        }

        if (value == null) {
          throw new ParseException(
              CoreErrorDomain.ERR.idValueRequired);
        }

        state.id = value;
      }
View Full Code Here

      // validate
      try {
        validate();
      } catch (IllegalStateException e) {
        throw new ParseException(e.getMessage(), e);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.util.ParseException

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.