congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ComplexPropertyContainer.addProperty
Code IndexAdd Tabnine to your IDE (free)

How to use
addProperty
method
in
org.apache.xmpbox.type.ComplexPropertyContainer

Best Java code snippets using org.apache.xmpbox.type.ComplexPropertyContainer.addProperty (Showing top 20 results out of 315)

origin: apache/pdfbox

private void manageSimpleType(XMPMetadata xmp, Element property, Types type, ComplexPropertyContainer container)
    throws XmpParsingException
{
  TypeMapping tm = xmp.getTypeMapping();
  String prefix = property.getPrefix();
  String name = property.getLocalName();
  String namespace = property.getNamespaceURI();
  AbstractSimpleProperty sp = tm.instanciateSimpleProperty(namespace, prefix, name, property.getTextContent(),
      type);
  loadAttributes(sp, property);
  container.addProperty(sp);
}
origin: apache/pdfbox

/**
 * Add a property to the current structure
 * 
 * @param obj
 *            the property to add
 */
public final void addProperty(AbstractField obj)
{
  // https://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/cs6/XMPSpecificationPart1.pdf
  // "Each property name in an XMP packet shall be unique within that packet"
  // "Multiple values are represented using an XMP array value"
  // "The nested element's element content shall consist of zero or more rdf:li elements, 
  // one for each item in the array"
  // thus delete existing elements of a property, except for arrays ("li")
  if (!(this instanceof ArrayProperty))
  {
    container.removePropertiesByName(obj.getPropertyName());
  }
  container.addProperty(obj);
}
origin: apache/pdfbox

private boolean mergeComplexProperty(Iterator<AbstractField> itNewValues, ArrayProperty arrayProperty)
{
  while (itNewValues.hasNext())
  {
    TextType tmpNewValue = (TextType) itNewValues.next();
    for (AbstractField abstractField : arrayProperty.getContainer().getAllProperties())
    {
      TextType tmpOldValue = (TextType) abstractField;
      if (tmpOldValue.getStringValue().equals(tmpNewValue.getStringValue()))
      {
        return true;
      }
    }
    arrayProperty.getContainer().addProperty(tmpNewValue);
  }
  return false;
}
origin: apache/pdfbox

private void internalAddBagValue(String qualifiedBagName, String bagValue)
{
  ArrayProperty bag = (ArrayProperty) getAbstractProperty(qualifiedBagName);
  TextType li = createTextType(XmpConstants.LIST_NAME, bagValue);
  if (bag != null)
  {
    bag.getContainer().addProperty(li);
  }
  else
  {
    ArrayProperty newBag = createArrayProperty(qualifiedBagName, Cardinality.Bag);
    newBag.getContainer().addProperty(li);
    addProperty(newBag);
  }
}
origin: apache/pdfbox

while (it.hasNext())
  alt.addProperty(it.next());
origin: apache/pdfbox

/**
 * Add a new value to a bag property.
 * 
 * @param qualifiedSeqName
 *            The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords"
 * @param seqValue
 *            The value to add to the bag.
 */
public void addBagValue(String qualifiedSeqName, AbstractField seqValue)
{
  ArrayProperty bag = (ArrayProperty) getAbstractProperty(qualifiedSeqName);
  if (bag != null)
  {
    bag.getContainer().addProperty(seqValue);
  }
  else
  {
    ArrayProperty newBag = createArrayProperty(qualifiedSeqName, Cardinality.Bag);
    newBag.getContainer().addProperty(seqValue);
    addProperty(newBag);
  }
}
origin: apache/pdfbox

/**
 * Add a new value to a sequence property.
 * 
 * @param seqName
 *            The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords"
 * @param seqValue
 *            The value to add to the sequence.
 */
public void addUnqualifiedSequenceValue(String seqName, AbstractField seqValue)
{
  ArrayProperty seq = (ArrayProperty) getAbstractProperty(seqName);
  if (seq != null)
  {
    seq.getContainer().addProperty(seqValue);
  }
  else
  {
    ArrayProperty newSeq = createArrayProperty(seqName, Cardinality.Seq);
    newSeq.getContainer().addProperty(seqValue);
    addProperty(newSeq);
  }
}
origin: apache/pdfbox

/**
 * Add a new value to a sequence property.
 * 
 * @param simpleSeqName
 *            The name of the sequence property without the namespace prefix
 * @param seqValue
 *            The value to add to the sequence.
 */
public void addUnqualifiedSequenceValue(String simpleSeqName, String seqValue)
{
  ArrayProperty seq = (ArrayProperty) getAbstractProperty(simpleSeqName);
  TextType li = createTextType(XmpConstants.LIST_NAME, seqValue);
  if (seq != null)
  {
    seq.getContainer().addProperty(li);
  }
  else
  {
    ArrayProperty newSeq = createArrayProperty(simpleSeqName, Cardinality.Seq);
    newSeq.getContainer().addProperty(li);
    addProperty(newSeq);
  }
}
origin: apache/pdfbox

container.addProperty(array);
List<Element> lis = DomHelper.getElementChildren(bagOrSeq);
origin: apache/pdfbox

container.addProperty(sp);
origin: apache/pdfbox

private void manageDefinedType(XMPMetadata xmp, Element property, String prefix, ComplexPropertyContainer container)
    throws XmpParsingException
{
  if (DomHelper.isParseTypeResource(property))
  {
    AbstractStructuredType ast = parseLiDescription(xmp, DomHelper.getQName(property), property);
    ast.setPrefix(prefix);
    container.addProperty(ast);
  }
  else
  {
    Element inner = DomHelper.getFirstChildElement(property);
    if (inner == null)
    {
      throw new XmpParsingException(ErrorType.Format, "property should contain child element : "
          + property);
    }
    AbstractStructuredType ast = parseLiDescription(xmp, DomHelper.getQName(property), inner);
    ast.setPrefix(prefix);
    container.addProperty(ast);
  }
}
origin: apache/pdfbox

private void manageStructuredType(XMPMetadata xmp, Element property, String prefix, ComplexPropertyContainer container)
    throws XmpParsingException
{
  if (DomHelper.isParseTypeResource(property))
  {
    AbstractStructuredType ast = parseLiDescription(xmp, DomHelper.getQName(property), property);
    if (ast != null)
    {
      ast.setPrefix(prefix);
      container.addProperty(ast);
    }
  }
  else
  {
    Element inner = DomHelper.getFirstChildElement(property);
    if (inner != null)
    {
      nsFinder.push(inner);
      AbstractStructuredType ast = parseLiDescription(xmp, DomHelper.getQName(property), inner);
      ast.setPrefix(prefix);
      container.addProperty(ast);
    }
  }
}
origin: apache/pdfbox

public void addTextLayers(String layerName, String layerText)
{
  if (seqLayer == null)
  {
    seqLayer = createArrayProperty(TEXT_LAYERS, Cardinality.Seq);
    addProperty(seqLayer);
  }
  LayerType layer = new LayerType(getMetadata());
  layer.setLayerName(layerName);
  layer.setLayerText(layerText);
  seqLayer.getContainer().addProperty(layer);
}
origin: apache/pdfbox

ast.getContainer().addProperty(array);
Element bagOrSeq = DomHelper.getUniqueElementChild(element);
List<Element> lis = DomHelper.getElementChildren(bagOrSeq);
    element.getTextContent(), type.type());
loadAttributes(sp, element);
ast.getContainer().addProperty(sp);
inner.setNamespace(namespace);
inner.setPrefix(prefix);
ast.getContainer().addProperty(inner);
ComplexPropertyContainer cpc = inner.getContainer();
if (DomHelper.isParseTypeResource(element))
origin: apache/pdfbox

public void addJob(JobType job)
{
  String prefix = getNamespacePrefix(job.getNamespace());
  if (prefix != null)
  {
    // use same prefix for all jobs
    job.setPrefix(prefix);
  }
  else
  {
    // add prefix
    addNamespace(job.getNamespace(), job.getPrefix());
  }
  // create bag if not existing
  if (bagJobs == null)
  {
    bagJobs = createArrayProperty(JOB_REF, Cardinality.Bag);
    addProperty(bagJobs);
  }
  // add job
  bagJobs.getContainer().addProperty(job);
}
origin: apache/pdfbox

        langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME,
            language));
        arrayProp.getContainer().addProperty(langValue);
  arrayProp.getContainer().addProperty(langValue);
  reorganizeAltOrder(arrayProp.getContainer());
TextType langValue = createTextType(XmpConstants.LIST_NAME, value);
langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME, language));
arrayProp.getContainer().addProperty(langValue);
addProperty(arrayProp);
origin: apache/pdfbox

/**
 * Add thumbnail to thumbnails list
 * 
 * @param height
 *            height format
 * @param width
 *            width format
 * @param format
 *            thumbnail format
 * @param img
 *            Image data
 */
public void addThumbnails(Integer height, Integer width, String format, String img)
{
  if (altThumbs == null)
  {
    altThumbs = createArrayProperty(THUMBNAILS, Cardinality.Alt);
    addProperty(altThumbs);
  }
  ThumbnailType thumb = new ThumbnailType(getMetadata());
  thumb.setHeight(height);
  thumb.setWidth(width);
  thumb.setFormat(format);
  thumb.setImage(img);
  altThumbs.getContainer().addProperty(thumb);
}
origin: org.apache.pdfbox/xmpbox

private void manageSimpleType(XMPMetadata xmp, Element property, Types type, ComplexPropertyContainer container)
    throws XmpParsingException
{
  TypeMapping tm = xmp.getTypeMapping();
  String prefix = property.getPrefix();
  String name = property.getLocalName();
  String namespace = property.getNamespaceURI();
  AbstractSimpleProperty sp = tm.instanciateSimpleProperty(namespace, prefix, name, property.getTextContent(),
      type);
  loadAttributes(sp, property);
  container.addProperty(sp);
}
origin: com.github.lafa.pdfbox/xmpbox

private void manageSimpleType(XMPMetadata xmp, Element property, Types type, ComplexPropertyContainer container)
    throws XmpParsingException
{
  TypeMapping tm = xmp.getTypeMapping();
  String prefix = property.getPrefix();
  String name = property.getLocalName();
  String namespace = property.getNamespaceURI();
  AbstractSimpleProperty sp = tm.instanciateSimpleProperty(namespace, prefix, name, property.getTextContent(),
      type);
  loadAttributes(sp, property);
  container.addProperty(sp);
}
origin: org.apache.pdfbox/xmpbox

public void addTextLayers(String layerName, String layerText)
{
  if (seqLayer == null)
  {
    seqLayer = createArrayProperty(TEXT_LAYERS, Cardinality.Seq);
    addProperty(seqLayer);
  }
  LayerType layer = new LayerType(getMetadata());
  layer.setLayerName(layerName);
  layer.setLayerText(layerText);
  seqLayer.getContainer().addProperty(layer);
}
org.apache.xmpbox.typeComplexPropertyContaineraddProperty

Javadoc

Add a property to the current structure

Popular methods of ComplexPropertyContainer

  • getAllProperties
    Return all children associated to this property
  • <init>
    Complex Property type constructor (namespaceURI is given)
  • containsProperty
    Check if a XMPFieldObject is in the complex property
  • getFirstEquivalentProperty
    Give the first property found in this container with type and localname expected
  • getPropertiesByLocalName
    Return all properties with this specified localName.
  • isSameProperty
    Check if two properties are equal.
  • removePropertiesByName
    Remove all properties with a specified LocalName.
  • removeProperty
    Remove a property

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • addToBackStack (FragmentTransaction)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now