/** * Created with IntelliJ IDEA. * User: yugui * Date: 07/12/13 * Time: 10:53 * To change this template use File | Settings | File Templates. */ @StructuredType(preferedPrefix = "xmpTPg",namespace = "http://ns.adobe.com/xap/1.0/t/pg/") public class XMPageTextSchema extends XMPSchema { @PropertyType(type = Types.Dimensions) public static final String MAX_PAGE_SIZE = "MaxPageSize"; @PropertyType(type = Types.Integer) public static final String N_PAGES = "NPages"; public XMPageTextSchema(XMPMetadata metadata) { super(metadata); } public XMPageTextSchema(XMPMetadata metadata, String prefix) { super(metadata, prefix); } }
throw new XmpParsingException(ErrorType.Format, "Invalid array definition, expecting " + type.card() + " and found " + whatFound + " [prefix=" + prefix + "; name=" + name + "]"); if (!bagOrSeq.getLocalName().equals(type.card().name())) throw new XmpParsingException(ErrorType.Format, "Invalid array type, expecting " + type.card() + " and found " + bagOrSeq.getLocalName() + " [prefix="+prefix+"; name="+name+"]"); ArrayProperty array = tm.createArrayProperty(namespace, prefix, name, type.card()); container.addProperty(array); List<Element> lis = DomHelper.getElementChildren(bagOrSeq); AbstractField ast = parseLiElement(xmp, propertyQName, element, type.type()); if (ast != null)
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) { PropertiesDescription pm = initializePropMapping(clz); PropertyType simpleType = pm.getPropertyType(propertyName); Types type = simpleType.type(); return instanciateSimpleProperty(nsuri, prefix, propertyName, value, type); }
@PropertyType(type = Types.LangAlt, card = Cardinality.Simple) public static final String IMAGE_DESCRIPTION = "ImageDescription"; @PropertyType(type = Types.LangAlt, card = Cardinality.Simple) public static final String COPYRIGHT = "Copyright"; @PropertyType(type = Types.ProperName, card = Cardinality.Simple) public static final String ARTIST = "Artist"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String IMAGE_WIDTH = "ImageWidth"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String IMAGE_LENGHT = "ImageLength"; @PropertyType(type = Types.Integer, card = Cardinality.Seq) public static final String BITS_PER_SAMPLE= "BitsPerSample"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String COMPRESSION = "Compression"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String PHOTOMETRIC_INTERPRETATION = "PhotometricInterpretation"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String ORIENTATION = "Orientation"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String SAMPLES_PER_PIXEL = "SamplesPerPixel";
attr.getLocalName(), attr.getValue(), type.type()); container.addProperty(sp);
@PropertyType(type = Types.LangAlt, card = Cardinality.Simple) public static final String USER_COMMENT = "UserComment"; @PropertyType(type=Types.Text, card= Cardinality.Simple) public static final String EXIF_VERSION = "ExifVersion"; @PropertyType(type=Types.Text, card= Cardinality.Simple) public static final String FLASH_PIX_VERSION = "FlashpixVersion"; @PropertyType(type=Types.Integer, card= Cardinality.Simple) public static final String COLOR_SPACE = "ColorSpace"; @PropertyType(type=Types.Integer, card= Cardinality.Seq) public static final String COMPONENTS_CONFIGURATION = "ComponentsConfiguration"; @PropertyType(type=Types.Rational, card= Cardinality.Simple) public static final String COMPRESSED_BPP = "CompressedBitsPerPixel"; @PropertyType(type=Types.Integer, card= Cardinality.Simple) public static final String PIXEL_X_DIMENSION = "PixelXDimension"; @PropertyType(type=Types.Integer, card= Cardinality.Simple) public static final String PIXEL_Y_DIMENSION = "PixelYDimension"; @PropertyType(type=Types.Text, card= Cardinality.Simple) public static final String RELATED_SOUND_FILE = "RelatedSoundFile"; @PropertyType(type=Types.Date, card= Cardinality.Simple) public static final String DATE_TIME_ORIGINAL = "DateTimeOriginal";
Types tt = ctype.type(); AbstractStructuredType ast = instanciateStructured(tm, tt, descriptor.getLocalPart(), first.getNamespaceURI()); + element.getNamespaceURI()); else if (type.card().isArray()) ArrayProperty array = tm.createArrayProperty(namespace, prefix, name, type.card()); ast.getContainer().addProperty(array); Element bagOrSeq = DomHelper.getUniqueElementChild(element); for (Element element2 : lis) AbstractField ast2 = parseLiElement(xmp, descriptor, element2, type.type()); if (ast2 != null) else if (type.type().isSimple()) element.getTextContent(), type.type()); loadAttributes(sp, element); ast.getContainer().addProperty(sp); else if (type.type().isStructured()) AbstractStructuredType inner = instanciateStructured(tm, type.type(), name, null); inner.setNamespace(namespace); inner.setPrefix(prefix);
private void parseDescriptionInner(XMPMetadata xmp, Element description, ComplexPropertyContainer parentContainer) throws XmpParsingException { nsFinder.push(description); TypeMapping tm = xmp.getTypeMapping(); try { List<Element> properties = DomHelper.getElementChildren(description); for (Element property : properties) { String name = property.getLocalName(); PropertyType dtype = checkPropertyDefinition(xmp, DomHelper.getQName(property)); PropertyType ptype = tm.getStructuredPropMapping(dtype.type()).getPropertyType(name); // create property createProperty(xmp, property, ptype, parentContainer); } } finally { nsFinder.pop(); } }
@PropertyType(type = Types.URI, card = Cardinality.Simple) public static final String ANCESTORID = "AncestorID"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String AUTHORS_POSITION = "AuthorsPosition"; @PropertyType(type = Types.ProperName, card = Cardinality.Simple) public static final String CAPTION_WRITER = "CaptionWriter"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String CATEGORY = "Category"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String CITY = "City"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String COLOR_MODE = "ColorMode"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String COUNTRY = "Country"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String CREDIT = "Credit"; @PropertyType(type = Types.Date, card = Cardinality.Simple) public static final String DATE_CREATED = "DateCreated"; @PropertyType(type = Types.Text, card = Cardinality.Bag) public static final String DOCUMENT_ANCESTORS = "DocumentAncestors";
throw new XmpParsingException(ErrorType.Format, "Invalid array definition, expecting " + type.card() + " and found " + whatFound + " [prefix=" + prefix + "; name=" + name + "]"); if (!bagOrSeq.getLocalName().equals(type.card().name())) throw new XmpParsingException(ErrorType.Format, "Invalid array type, expecting " + type.card() + " and found " + bagOrSeq.getLocalName() + " [prefix="+prefix+"; name="+name+"]"); ArrayProperty array = tm.createArrayProperty(namespace, prefix, name, type.card()); container.addProperty(array); List<Element> lis = DomHelper.getElementChildren(bagOrSeq); AbstractField ast = parseLiElement(xmp, propertyQName, element, type.type()); if (ast != null)
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) { PropertiesDescription pm = initializePropMapping(clz); PropertyType simpleType = pm.getPropertyType(propertyName); Types type = simpleType.type(); return instanciateSimpleProperty(nsuri, prefix, propertyName, value, type); }
@PropertyType(type = Types.PDFASchema, card = Cardinality.Bag) public static final String SCHEMAS = "schemas";
throw new XmpParsingException(ErrorType.Format, "Invalid array definition, expecting " + type.card() + " and found " + whatFound + " [prefix=" + prefix + "; name=" + name + "]"); if (!bagOrSeq.getLocalName().equals(type.card().name())) throw new XmpParsingException(ErrorType.Format, "Invalid array type, expecting " + type.card() + " and found " + bagOrSeq.getLocalName() + " [prefix="+prefix+"; name="+name+"]"); ArrayProperty array = tm.createArrayProperty(namespace, prefix, name, type.card()); container.addProperty(array); List<Element> lis = DomHelper.getElementChildren(bagOrSeq); AbstractField ast = parseLiElement(xmp, propertyQName, element, type.type()); if (ast != null)
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) { PropertiesDescription pm = initializePropMapping(clz); PropertyType simpleType = pm.getPropertyType(propertyName); Types type = simpleType.type(); return instanciateSimpleProperty(nsuri, prefix, propertyName, value, type); }
@PropertyType(type = Types.URL, card = Cardinality.Simple) public static final String CERTIFICATE = "Certificate"; @PropertyType(type = Types.Boolean, card = Cardinality.Simple) public static final String MARKED = "Marked"; @PropertyType(type = Types.ProperName, card = Cardinality.Bag) public static final String OWNER = "Owner"; @PropertyType(type = Types.LangAlt, card = Cardinality.Simple) public static final String USAGETERMS = "UsageTerms"; @PropertyType(type = Types.URL, card = Cardinality.Simple) public static final String WEBSTATEMENT = "WebStatement";
attr.getLocalName(), attr.getValue(), type.type()); container.addProperty(sp);
@PropertyType(type = Types.XPath, card = Cardinality.Bag) public static final String ADVISORY = "Advisory"; @PropertyType(type = Types.URL, card = Cardinality.Simple) public static final String BASEURL = "BaseURL"; @PropertyType(type = Types.Date, card = Cardinality.Simple) public static final String CREATEDATE = "CreateDate"; @PropertyType(type = Types.AgentName, card = Cardinality.Simple) public static final String CREATORTOOL = "CreatorTool"; @PropertyType(type = Types.Text, card = Cardinality.Bag) public static final String IDENTIFIER = "Identifier"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String LABEL = "Label"; @PropertyType(type = Types.Date, card = Cardinality.Simple) public static final String METADATADATE = "MetadataDate"; @PropertyType(type = Types.Date, card = Cardinality.Simple) public static final String MODIFYDATE = "ModifyDate"; @PropertyType(type = Types.Text, card = Cardinality.Simple) public static final String NICKNAME = "Nickname"; @PropertyType(type = Types.Integer, card = Cardinality.Simple) public static final String RATING = "Rating";