Package com.adobe.xmp

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


   */
  public void assertConsistency(int options) throws XMPException
  {
    if ((options & STRUCT) > &&  (options & ARRAY) > 0)
    {
      throw new XMPException("IsStruct and IsArray options are mutually exclusive",
          XMPError.BADOPTIONS);
    }
    else if ((options & URI) > &&  (options & (ARRAY | STRUCT)) > 0)
    { 
      throw new XMPException("Structs and arrays can't have \"value\" options",
        XMPError.BADOPTIONS);
    }
  }
View Full Code Here

  private void assertChildNotExisting(String childName) throws XMPException
  {
    if (!XMPConst.ARRAY_ITEM_NAME.equals(childName&&
      findChildByName(childName) != null)
    {
      throw new XMPException("Duplicate property or field node '" + childName + "'",
          XMPError.BADXMP);
    }
  }
View Full Code Here

  private void assertQualifierNotExisting(String qualifierName) throws XMPException
  {
    if (!XMPConst.ARRAY_ITEM_NAME.equals(qualifierName&&
      findQualifierByName(qualifierName) != null)
    {
      throw new XMPException("Duplicate '" + qualifierName + "' qualifier", XMPError.BADXMP);
    }
  }
View Full Code Here

    }
   
    if (!Utils.isXMLNameNS(suggestedPrefix.substring(0,
        suggestedPrefix.length() - 1)))
    {
      throw new XMPException("The prefix is a bad XML name", XMPError.BADXML);
    }
   
    String registeredPrefix = (String) namespaceToPrefixMap.get(namespaceURI);
    String registeredNS = (String) prefixToNamespaceMap.get(suggestedPrefix);
    if (registeredPrefix != null)
View Full Code Here

        aliasForm.toPropertyOptions(), null).getOptions()) :
      new AliasOptions();
 
    if (p.matcher(aliasProp).find()  ||  p.matcher(actualProp).find())
    {
      throw new XMPException("Alias and actual property names must be simple",
          XMPError.BADXPATH);
    }
   
    // check if both namespaces are registered
    final String aliasPrefix = getNamespacePrefix(aliasNS);
    final String actualPrefix = getNamespacePrefix(actualNS);
    if (aliasPrefix == null)
    {
      throw new XMPException("Alias namespace is not registered", XMPError.BADSCHEMA);
    }
    else if (actualPrefix == null)
    {
      throw new XMPException("Actual namespace is not registered",
        XMPError.BADSCHEMA);
    }
   
    String key = aliasPrefix + aliasProp;
   
    // check if alias is already existing
    if (aliasMap.containsKey(key))
    {
      throw new XMPException("Alias is already existing", XMPError.BADPARAM);
    }
    else if (aliasMap.containsKey(actualPrefix + actualProp))
    { 
      throw new XMPException(
          "Actual property is already an alias, use the base property",
          XMPError.BADPARAM);
    }
   
    XMPAliasInfo aliasInfo = new XMPAliasInfo()
View Full Code Here

        ByteBuffer buffer = new ByteBuffer(stream);
        return parseXmlFromBytebuffer(buffer, options);
      }
      catch (IOException e)
      {
        throw new XMPException("Error reading the XML-file",
            XMPError.BADSTREAM, e);
      }
    }
  }
View Full Code Here

            return parseInputSource(new InputSource(fixReader));
          }
          catch (UnsupportedEncodingException e1)
          {
            // can normally not happen as the encoding is provided by a util function
            throw new XMPException("Unsupported Encoding",
                XMPError.INTERNALFAILURE, e);
          }
        }
        source = new InputSource(buffer.getByteStream());
        return parseInputSource(source);
View Full Code Here

      builder.setErrorHandler(null);
      return builder.parse(source);
    }
    catch (SAXException e)
    {
      throw new XMPException("XML parsing failure", XMPError.BADXML, e);
    }
    catch (ParserConfigurationException e)
    {
      throw new XMPException("XML Parser not correctly configured",
          XMPError.UNKNOWN, e);
    }
    catch (IOException e)
    {
      throw new XMPException("Error reading the XML-file", XMPError.BADSTREAM, e);
    }
  }
View Full Code Here

     
      outputStream.close();
    }
    catch (IOException e)
    {
      throw new XMPException("Error writing to the OutputStream", XMPError.UNKNOWN);
    }
  }
View Full Code Here

TOP

Related Classes of com.adobe.xmp.XMPException

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.