Package com.google.gdata.util

Examples of com.google.gdata.util.ParseException


     
      // Process the name tag only.  The content will be parsed as XmlBlob
      if (localName.equals(CONTENT_NAME)) {
        contentName = localValue;
      } else {
        throw new ParseException("Unknown key = " + localName + " in this name space");
      }
    }
View Full Code Here


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

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

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

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

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

          if (srcState.subtitle != null) {
            throw new ParseException(
                CoreErrorDomain.ERR.duplicateSubtitle);
          }

          srcState.subtitle = chi.textConstruct;
          return chi.handler;

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

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

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

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

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

          return new IconHandler();

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

          return new LogoHandler();

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

          Link link = new Link();
          srcState.links.add(link);
          return link.new AtomHandler(extProfile);

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

          Person author = new Person();
          srcState.authors.add(author);
          return author.new AtomHandler(extProfile);

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

          Person contributor = new Person();
          srcState.contributors.add(contributor);
          return contributor.new AtomHandler(extProfile);

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

          if (srcState.generator != null) {
            throw new ParseException(
                CoreErrorDomain.ERR.duplicateGenerator);
          }

          srcState.generator = new Generator();
          return srcState.generator.new AtomHandler();
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

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

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

        srcState.id = value;
      }
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (srcState.icon != null) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateIcon);
        }

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

        srcState.icon = value;
      }
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (srcState.logo != null) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateLogo);
        }

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

        srcState.logo = value;
      }
View Full Code Here

            allowsArbitraryXml = true;
          } else if (arbitraryXmlAttr.equals("false") ||
                     arbitraryXmlAttr.equals("0")) {
            allowsArbitraryXml = false;
          } else {
            ParseException pe = new ParseException(
                CoreErrorDomain.ERR.invalidArbitraryXml);
            pe.setInternalReason("Invalid value for arbitaryXml: " +
                                     arbitraryXmlAttr);
            throw pe;
          }
        }
      }
View Full Code Here

        if (localName.equals("namespaceDescription")) {

          String alias = attrs.getValue("", "alias");
          if (alias == null) {
            ParseException pe = new ParseException(
                CoreErrorDomain.ERR.missingAttribute);
            pe.setInternalReason(
                      "NamespaceDescription alias attribute is missing");
            throw pe;
          }
          String uri = attrs.getValue("", "uri");
          if (uri == null) {
            ParseException pe = new ParseException(
                CoreErrorDomain.ERR.missingAttribute);
            pe.setInternalReason(
                      "NamespaceDescription uri attribute is missing");
            throw pe;
          }

          XmlNamespace declaredNs = new XmlNamespace(alias, uri);
View Full Code Here

      this.configLoader = configLoader;
      this.namespaces = namespaces;

      String extendedClassName = attrs.getValue("", "extendedClass");
      if (extendedClassName == null) {
        ParseException pe = new ParseException(
            CoreErrorDomain.ERR.missingAttribute);
        pe.setInternalReason(
            "ExtensionPoint extendedClass attribute is missing");
        throw pe;
      }

      Class<?> loadedClass;
      try {
        loadedClass = configLoader.loadClass(extendedClassName);
      } catch (ClassNotFoundException e) {
        throw new ParseException(
            CoreErrorDomain.ERR.cantLoadExtensionPoint, e);
      }
      if (!ExtensionPoint.class.isAssignableFrom(loadedClass)) {
        throw new ParseException(
            CoreErrorDomain.ERR.mustExtendExtensionPoint);
      }
      extensionPoint = extensionPointClass(loadedClass);

      String arbitraryXmlAttr = attrs.getValue("", "arbitraryXml");
      if (arbitraryXmlAttr != null) {
        if (arbitraryXmlAttr.equals("true") || arbitraryXmlAttr.equals("1")) {
          arbitraryXml = true;
        } else if (arbitraryXmlAttr.equals("false") ||
                   arbitraryXmlAttr.equals("0")) {
          arbitraryXml = false;
        } else {
          ParseException pe = new ParseException(
              CoreErrorDomain.ERR.invalidArbitraryXml);
          pe.setInternalReason("Invalid value for arbitaryXml: " +
                                   arbitraryXmlAttr);
          throw pe;
        }
      }
    }
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (name != null) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateName);
        }

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

        name = value;
        nameLang = xmlLang;
View Full Code Here

      @Override
      public void processEndElement() throws ParseException {

        if (uri != null) {
          throw new ParseException(
              CoreErrorDomain.ERR.duplicateUri);
        }

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

        uri = value;
      }
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.