Examples of XMPException


Examples of com.adobe.xmp.XMPException

    {
      assertConsistency(options);
    }
    else
    {
      throw new XMPException("The option bit(s) 0x" + Integer.toHexString(invalidOptions)
          + " are invalid!", XMPError.BADOPTIONS);
    }
  }
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

    {
      rdf_NodeElementList (xmp, xmp.getRoot(), rdfRdfNode);
   
    else
   
      throw new XMPException("Invalid attributes of rdf:RDF element", BADRDF);
    }
  }
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

      boolean isTopLevel) throws XMPException
  {
    int nodeTerm = getRDFTermKind (xmlNode);
    if (nodeTerm != RDFTERM_DESCRIPTION  &&  nodeTerm != RDFTERM_OTHER)
    {
      throw new XMPException("Node element must be rdf:Description or typed node",
        BADRDF);
    }
    else if (isTopLevel  &&  nodeTerm == RDFTERM_OTHER)
    {
      throw new XMPException("Top level typed node not allowed", BADXMP);
    }
    else
    {
      rdf_NodeElementAttrs (xmp, xmpParent, xmlNode, isTopLevel);
      rdf_PropertyElementList (xmp, xmpParent, xmlNode, isTopLevel);
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

        case RDFTERM_ID:
        case RDFTERM_NODE_ID:
        case RDFTERM_ABOUT:
          if (exclusiveAttrs > 0)
          {
            throw new XMPException("Mutally exclusive about, ID, nodeID attributes",
                BADRDF);
          }
         
          exclusiveAttrs++;
 
          if (isTopLevel && (attrTerm == RDFTERM_ABOUT))
          {
            // This is the rdf:about attribute on a top level node. Set
            // the XMP tree name if
            // it doesn't have a name yet. Make sure this name matches
            // the XMP tree name.
            if (xmpParent.getName() != null && xmpParent.getName().length() > 0)
            {
              if (!xmpParent.getName().equals(attribute.getNodeValue()))
              {
                throw new XMPException("Mismatched top level rdf:about values",
                    BADXMP);
              }
            }
            else
            {
              xmpParent.setName(attribute.getNodeValue());
            }
          }
          break;
 
        case RDFTERM_OTHER:
          addChildNode(xmp, xmpParent, attribute, attribute.getNodeValue(), isTopLevel);
          break;
 
        default:
          throw new XMPException("Invalid nodeElement attribute", BADRDF);
      }

    }   
  }
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

      {
        continue;
     
      else if (currChild.getNodeType() != Node.ELEMENT_NODE)
      {
        throw new XMPException("Expected property element node not found", BADRDF);
      }
      else
     
        rdf_PropertyElement(xmp, xmpParent, currChild, isTopLevel);
     
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

      boolean isTopLevel) throws XMPException
  {
    int nodeTerm = getRDFTermKind (xmlNode);
    if (!isPropertyElementName(nodeTerm))
    {
      throw new XMPException("Invalid property element name", BADRDF);
    }
   
    // remove the namespace-definitions from the list
    NamedNodeMap attributes = xmlNode.getAttributes();
    List nsAttrs = null;
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

      {
        continue// Ignore all rdf:ID attributes.
      }
      else
      {
        throw new XMPException(
          "Invalid attribute for resource property element", BADRDF);
      }
    }

    // walk through the children
   
    Node currChild = null;
    boolean found = false;
    int i;
    for (i = 0; i < xmlNode.getChildNodes().getLength(); i++)
    {
      currChild = xmlNode.getChildNodes().item(i);
      if (!isWhitespaceNode(currChild))
      {
        if (currChild.getNodeType() == Node.ELEMENT_NODE  &&  !found)
        {
          boolean isRDF = NS_RDF.equals(currChild.getNamespaceURI());
          String childLocal = currChild.getLocalName();
         
          if (isRDF  &&  "Bag".equals(childLocal))
          {
            newCompound.getOptions().setArray(true);
          }
          else if (isRDF  &&  "Seq".equals(childLocal))
          {
            newCompound.getOptions().setArray(true).setArrayOrdered(true);
          }
          else if (isRDF  &&  "Alt".equals(childLocal))
          {
            newCompound.getOptions().setArray(true).setArrayOrdered(true)
                .setArrayAlternate(true);
          }
          else
          {
            newCompound.getOptions().setStruct(true);
            if (!isRDF  &&  !"Description".equals(childLocal))
            {
              String typeName = currChild.getNamespaceURI();
              if (typeName == null)
              {
                throw new XMPException(
                    "All XML elements must be in a namespace", BADXMP);
              }
              typeName += ':' + childLocal;
              addQualifierNode (newCompound, "rdf:type", typeName);
            }
          }
 
          rdf_NodeElement (xmp, newCompound, currChild, false);
         
          if (newCompound.getHasValueChild())
          {
            fixupQualifiedNode (newCompound);
          }
          else if (newCompound.getOptions().isArrayAlternate())
          {
            XMPNodeUtils.detectAltText(newCompound);
          }       
         
          found = true;
        }
        else if (found)
        {
          // found second child element
          throw new XMPException(
            "Invalid child of resource property element", BADRDF);
        }
        else
        {
          throw new XMPException(
            "Children of resource property element must be XML elements", BADRDF);
        }
      }
    }
   
    if (!found)
    {
      // didn't found any child elements
      throw new XMPException("Missing child of resource property element", BADRDF);
    }
  } 
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

      {
        continue// Ignore all rdf:ID and rdf:datatype attributes.
      }
      else
      {
        throw new XMPException(
          "Invalid attribute for literal property element", BADRDF);
      }
    }
    String textValue = "";
    for (int i = 0; i < xmlNode.getChildNodes().getLength(); i++)
    {
      Node child = xmlNode.getChildNodes().item(i);
      if (child.getNodeType() == Node.TEXT_NODE)
      {
        textValue += child.getNodeValue();
      }
      else
      {
        throw new XMPException("Invalid child of literal property element", BADRDF);
      }
    }
    newChild.setValue(textValue);
  }
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

   *
   * @throws XMPException thown on parsing errors
   */
  private static void rdf_ParseTypeLiteralPropertyElement() throws XMPException
  {
    throw new XMPException("ParseTypeLiteral property element not allowed", BADXMP);
  }
View Full Code Here

Examples of com.itextpdf.xmp.XMPException

        continue// The caller ensured the value is "Resource".
              // Ignore all rdf:ID attributes.
      }
      else
      {
        throw new XMPException("Invalid attribute for ParseTypeResource property element",
            BADRDF);
      }
    }

    rdf_PropertyElementList (xmp, newStruct, xmlNode, false);
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.