Package com.adobe.xmp.properties

Examples of com.adobe.xmp.properties.XMPAliasInfo


      throw new XMPException(
          "Actual property is already an alias, use the base property",
          XMPError.BADPARAM);
    }
   
    XMPAliasInfo aliasInfo = new XMPAliasInfo()
    {
      /**
       * @see XMPAliasInfo#getNamespace()
       */
      public String getNamespace()
View Full Code Here


        }
       
        currProp.setAlias(false);
 
        // Find the base path, look for the base schema and root node.
        XMPAliasInfo info = XMPMetaFactory.getSchemaRegistry()
            .findAlias(currProp.getName());
        if (info != null)
        { 
          // find or create schema
          XMPNode baseSchema = XMPNodeUtils.findSchemaNode(tree, info
              .getNamespace(), null, true);
          baseSchema.setImplicit(false);
         
          XMPNode baseNode = XMPNodeUtils
              .findChildNode(baseSchema,
                info.getPrefix() + info.getPropName(), false);
          if (baseNode == null)
          {
            if (info.getAliasForm().isSimple())
            {
              // A top-to-top alias, transplant the property.
              // change the alias property name to the base name
              String qname = info.getPrefix() + info.getPropName();
              currProp.setName(qname);
              baseSchema.addChild(currProp);
              // remove the alias property
              propertyIt.remove();
            }
            else
            {
              // An alias to an array item,
              // create the array and transplant the property.
              baseNode = new XMPNode(info.getPrefix() + info.getPropName(), info
                  .getAliasForm().toPropertyOptions());
              baseSchema.addChild(baseNode);
              transplantArrayItemAlias (propertyIt, currProp, baseNode);
            }
         
          }
          else if (info.getAliasForm().isSimple())
          {
            // The base node does exist and this is a top-to-top alias.
            // Check for conflicts if strict aliasing is on.
            // Remove and delete the alias subtree.
            if (strictAliasing)
            {
              compareAliasedSubtrees (currProp, baseNode, true);
            }
           
            propertyIt.remove();
          }
          else
          {
            // This is an alias to an array item and the array exists.
            // Look for the aliased item.
            // Then transplant or check & delete as appropriate.
           
            XMPNode  itemNode = null;
            if (info.getAliasForm().isArrayAltText())
            {
              int xdIndex = XMPNodeUtils.lookupLanguageItem(baseNode,
                  XMPConst.X_DEFAULT);
              if (xdIndex != -1)
              {
View Full Code Here

    {
      throw new XMPException("Empty initial XMPPath step", XMPError.BADXPATH);
    }
   
    String rootProp = verifyXPathRoot(schemaNS, pos.path.substring(pos.stepBegin, pos.stepEnd));
    XMPAliasInfo aliasInfo = XMPMetaFactory.getSchemaRegistry().findAlias(rootProp);
    if (aliasInfo == null)
    {
      // add schema xpath step
      expandedXPath.add(new XMPPathSegment(schemaNS, XMPPath.SCHEMA_NODE));
      XMPPathSegment rootStep = new XMPPathSegment(rootProp, XMPPath.STRUCT_FIELD_STEP);
      expandedXPath.add(rootStep);
    }
    else
    {
      // add schema xpath step and base step of alias
      expandedXPath.add(new XMPPathSegment(aliasInfo.getNamespace(), XMPPath.SCHEMA_NODE));
      XMPPathSegment rootStep = new XMPPathSegment(verifyXPathRoot(aliasInfo.getNamespace(),
          aliasInfo.getPropName()),
          XMPPath.STRUCT_FIELD_STEP);
      rootStep.setAlias(true);
      rootStep.setAliasForm(aliasInfo.getAliasForm().getOptions());
      expandedXPath.add(rootStep);
     
      if (aliasInfo.getAliasForm().isArrayAltText())
      {
        XMPPathSegment qualSelectorStep = new XMPPathSegment("[?xml:lang='x-default']",
            XMPPath.QUAL_SELECTOR_STEP);
        qualSelectorStep.setAlias(true);
        qualSelectorStep.setAliasForm(aliasInfo.getAliasForm().getOptions());
        expandedXPath.add(qualSelectorStep);
      }
      else if (aliasInfo.getAliasForm().isArray())
      {
        XMPPathSegment indexStep = new XMPPathSegment("[1]",
          XMPPath.ARRAY_INDEX_STEP);
        indexStep.setAlias(true);
        indexStep.setAliasForm(aliasInfo.getAliasForm().getOptions());
        expandedXPath.add(indexStep);
      }
    }
  }
View Full Code Here

        // from the alias, to make sure the actual exists.

        XMPAliasInfo[] aliases = XMPMetaFactory.getSchemaRegistry().findAliases(schemaNS);
        for (int i = 0; i < aliases.length; i++)
        {
          XMPAliasInfo info = aliases[i];
          XMPPath path = XMPPathParser.expandXPath(info.getNamespace(), info
              .getPropName());
          XMPNode actualProp = XMPNodeUtils
              .findNode(xmpImpl.getRoot(), path, false, null);
          if (actualProp != null)
          {
View Full Code Here

TOP

Related Classes of com.adobe.xmp.properties.XMPAliasInfo

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.