org.docx4j.openpackaging.parts.opendope.ComponentsPart Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docx4j Show documentation
Show all versions of docx4j Show documentation
docx4j is a library which helps you to work with the Office Open
XML file format as used in docx
documents, pptx presentations, and xlsx spreadsheets.
package org.docx4j.openpackaging.parts.opendope;
import javax.xml.bind.JAXBContext;
import org.docx4j.model.datastorage.InputIntegrityException;
import org.docx4j.openpackaging.exceptions.InvalidFormatException;
import org.docx4j.openpackaging.parts.PartName;
import org.opendope.components.Components.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ComponentsPart extends JaxbCustomXmlDataStoragePart {
private static Logger log = LoggerFactory.getLogger(ComponentsPart.class);
public ComponentsPart(PartName partName) throws InvalidFormatException {
super(partName);
init();
}
public ComponentsPart(PartName partName, JAXBContext jc) throws InvalidFormatException {
super(partName, jc);
init();
}
public static Component getComponentById(
org.opendope.components.Components components,
String id) {
for (Component c : components.getComponent() ) {
if (c.getId().equals(id))
return c;
}
throw new InputIntegrityException("No component with id " + id );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy