private void enqueueKids(PDField node) { queue.add(node); if (node instanceof PDNonTerminalField) { List<PDField> kids = ((PDNonTerminalField) node).getChildren(); for (PDField kid : kids) { enqueueKids(kid); } } } }
COSArray kids = (COSArray)getCOSObject().getDictionaryObject(COSName.KIDS); for (int i = 0; i < kids.size(); i++) if (kid instanceof COSDictionary) if (kid.getCOSObject() == this.getCOSObject()) PDField field = PDField.fromDictionary(getAcroForm(), (COSDictionary) kid, this); if (field != null)
@Override public int getFieldFlags() { int retval = 0; COSInteger ff = (COSInteger) getCOSObject().getDictionaryObject(COSName.FF); if (ff != null) { retval = ff.intValue(); } else if (getParent() != null) { retval = getParent().getFieldFlags(); } return retval; }
@Override FDFField exportFDF() throws IOException { FDFField fdfField = new FDFField(); fdfField.setPartialFieldName(getPartialName()); fdfField.setValue(getValue()); List<PDField> children = getChildren(); List<FDFField> fdfChildren = new ArrayList<>(); for (PDField child : children) { fdfChildren.add(child.exportFDF()); } fdfField.setKids(fdfChildren); return fdfField; }
/** * Returns the default value of this field. This may be of any kind which is valid for this field's * children. * * <p><b>Note:</b> while non-terminal fields <b>do</b> inherit field values, this method returns * the local value, without inheritance. */ public COSBase getDefaultValue() { return getCOSObject().getDictionaryObject(COSName.DV); }
/** * Calls createNonTerminalFields on all root non-terminal fields. * Otherwise, root fields are added to the acro form field collection. */ private void createNonTerminalFields(PDAcroForm form) { for (Field f : allFieldMap.values()) { if (!f.isTerminal) { PDNonTerminalField nonTerminal = new PDNonTerminalField(form); nonTerminal.setPartialName(f.partialName); f.field = nonTerminal; } } for (Field f : allFieldMap.values()) { if (!f.qualifiedName.contains(".")) { createNonTerminalFields(f, form); form.getFields().add(f.field); } } }
if (kid instanceof COSDictionary && ((COSDictionary) kid).getString(COSName.T) != null) return new PDNonTerminalField(form, field, parent);
@Override public String getFieldType() { String fieldType = getCOSObject().getNameAsString(COSName.FT); if (fieldType == null && getParent() != null) { fieldType = getParent().getFieldType(); } return fieldType; }
/** * Returns the fully qualified name of the field, which is a concatenation of the names of all the parents fields. * * @return the name of the field */ public String getFullyQualifiedName() { String finalName = getPartialName(); String parentName = parent != null ? parent.getFullyQualifiedName() : null; if (parentName != null) { if (finalName != null) { finalName = parentName + "." + finalName; } else { finalName = parentName; } } return finalName; }
@Override FDFField exportFDF() throws IOException { FDFField fdfField = new FDFField(); fdfField.setPartialFieldName(getPartialName()); fdfField.setValue(getValue()); List<PDField> children = getChildren(); List<FDFField> fdfChildren = new ArrayList<FDFField>(); for (PDField child : children) { fdfChildren.add(child.exportFDF()); } fdfField.setKids(fdfChildren); return fdfField; }
/** * {@inheritDoc} * * <p><b>Note:</b> while non-terminal fields <b>do</b> inherit field values, this method returns * the local value, without inheritance. */ @Override public String getValueAsString() { COSBase fieldValue = getCOSObject().getDictionaryObject(COSName.V); return fieldValue != null ? fieldValue.toString() : ""; }
/** * Calls createNonTerminalFields on all root non-terminal fields. * Otherwise, root fields are added to the acro form field collection. */ private void createNonTerminalFields(PDAcroForm form) { for (Field f : allFieldMap.values()) { if (!f.isTerminal) { PDNonTerminalField nonTerminal = new PDNonTerminalField(form); nonTerminal.setPartialName(f.partialName); f.field = nonTerminal; } } for (Field f : allFieldMap.values()) { if (!f.qualifiedName.contains(".")) { createNonTerminalFields(f, form); form.getFields().add(f.field); } } }
if (kid instanceof COSDictionary && ((COSDictionary) kid).getString(COSName.T) != null) return new PDNonTerminalField(form, field, parent);
@Override public String getFieldType() { String fieldType = getCOSObject().getNameAsString(COSName.FT); if (fieldType == null && getParent() != null) { fieldType = getParent().getFieldType(); } return fieldType; }
/** * Returns the fully qualified name of the field, which is a concatenation of the names of all the parents fields. * * @return the name of the field */ public String getFullyQualifiedName() { String finalName = getPartialName(); String parentName = parent != null ? parent.getFullyQualifiedName() : null; if (parentName != null) { if (finalName != null) { finalName = parentName + "." + finalName; } else { finalName = parentName; } } return finalName; }
for (PDField child : ((PDNonTerminalField)field).getChildren())
@Override FDFField exportFDF() throws IOException { FDFField fdfField = new FDFField(); fdfField.setPartialFieldName(getPartialName()); fdfField.setValue(getValue()); List<PDField> children = getChildren(); List<FDFField> fdfChildren = new ArrayList<>(); for (PDField child : children) { fdfChildren.add(child.exportFDF()); } fdfField.setKids(fdfChildren); return fdfField; }
/** * {@inheritDoc} * * <p><b>Note:</b> while non-terminal fields <b>do</b> inherit field values, this method returns * the local value, without inheritance. */ @Override public String getFieldType() { return getCOSObject().getNameAsString(COSName.FT); }
COSArray kids = (COSArray)getCOSObject().getDictionaryObject(COSName.KIDS); for (int i = 0; i < kids.size(); i++) if (kid instanceof COSDictionary) if (kid.getCOSObject() == this.getCOSObject()) PDField field = PDField.fromDictionary(getAcroForm(), (COSDictionary) kid, this); if (field != null)
if (kid instanceof COSDictionary && ((COSDictionary) kid).getString(COSName.T) != null) return new PDNonTerminalField(form, field, parent);