org.verapdf.pd.PDNamesDictionary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parser Show documentation
Show all versions of parser Show documentation
veraPDF tools for parsing, modifying and creating PDF documents.
package org.verapdf.pd;
import org.verapdf.as.ASAtom;
import org.verapdf.cos.COSObjType;
import org.verapdf.cos.COSObject;
/**
* @author Maksim Bezrukov
*/
public class PDNamesDictionary extends PDObject {
public PDNamesDictionary(COSObject obj) {
super(obj);
}
public PDNameTreeNode getEmbeddedFiles() {
return getNameTreeByName(ASAtom.EMBEDDED_FILES);
}
public PDNameTreeNode getJavaScript() {
return getNameTreeByName(ASAtom.JAVA_SCRIPT);
}
private PDNameTreeNode getNameTreeByName(ASAtom name) {
COSObject base = getKey(name);
if (base != null && base.getType() == COSObjType.COS_DICT) {
return PDNameTreeNode.create(base);
}
return null;
}
}