private static void populatePDFAFieldType(PDFAFieldType field, DefinedStructuredType structuredType) throws XmpParsingException { String fName = field.getName(); String fDescription = field.getDescription(); String fValueType = field.getValueType(); if (fName == null || fDescription == null || fValueType == null) { throw new XmpParsingException(ErrorType.RequiredProperty, "Missing field in field definition"); } try { Types fValue = Types.valueOf(fValueType); structuredType.addProperty(fName, TypeMapping.createPropertyType(fValue, Cardinality.Simple)); } catch (IllegalArgumentException e) { throw new XmpParsingException(ErrorType.NoValueType, "Type not defined : " + fValueType, e); // TODO could fValueType be a structured type ? } }
private DefinedStructuredType addProperty(ArrayProperty parent, String name, String type, String category, String description) { XMPMetadata metadata = getMetadata(); DefinedStructuredType li = new DefinedStructuredType(metadata, getNamespace(), getPrefix(), XmpConstants.LIST_NAME); li.setAttribute(new Attribute(getNamespace(), XmpConstants.PARSE_TYPE, XmpConstants.RESOURCE_NAME)); ChoiceType pdfa2 = new ChoiceType(metadata, xmlns_pdfaProperty, prefix_pdfaProperty, PDFAPropertyType.NAME, name); li.addProperty(pdfa2); pdfa2 = new ChoiceType(metadata, xmlns_pdfaProperty, prefix_pdfaProperty, PDFAPropertyType.VALUETYPE, type); li.addProperty(pdfa2); pdfa2 = new ChoiceType(metadata, xmlns_pdfaProperty, prefix_pdfaProperty, PDFAPropertyType.CATEGORY, category); li.addProperty(pdfa2); pdfa2 = new ChoiceType(metadata, xmlns_pdfaProperty, prefix_pdfaProperty, PDFAPropertyType.DESCRIPTION, description); li.addProperty(pdfa2); parent.addProperty(li); return li; }
TextType pdfa1 = new TextType(metadata, xmlns_pdfaSchema, prefix_pdfaSchema, PDFASchemaType.SCHEMA, "ZUGFeRD PDFA Extension Schema"); li.addProperty(pdfa1); li.addProperty(pdfa1); li.addProperty(pdfa1); li.addProperty(newSeq);
private static void populatePDFAFieldType(PDFAFieldType field, DefinedStructuredType structuredType) throws XmpParsingException { String fName = field.getName(); String fDescription = field.getDescription(); String fValueType = field.getValueType(); if (fName == null || fDescription == null || fValueType == null) { throw new XmpParsingException(ErrorType.RequiredProperty, "Missing field in field definition"); } try { Types fValue = Types.valueOf(fValueType); structuredType.addProperty(fName, TypeMapping.createPropertyType(fValue, Cardinality.Simple)); } catch (IllegalArgumentException e) { throw new XmpParsingException(ErrorType.NoValueType, "Type not defined : " + fValueType, e); // TODO could fValueType be a structured type ? } }
private static void populatePDFAFieldType(PDFAFieldType field, DefinedStructuredType structuredType) throws XmpParsingException { String fName = field.getName(); String fDescription = field.getDescription(); String fValueType = field.getValueType(); if (fName == null || fDescription == null || fValueType == null) { throw new XmpParsingException(ErrorType.RequiredProperty, "Missing field in field definition"); } try { Types fValue = Types.valueOf(fValueType); structuredType.addProperty(fName, TypeMapping.createPropertyType(fValue, Cardinality.Simple)); } catch (IllegalArgumentException e) { throw new XmpParsingException(ErrorType.NoValueType, "Type not defined : " + fValueType, e); // TODO could fValueType be a structured type ? } }