Package org.apache.xmpbox.type

Examples of org.apache.xmpbox.type.PropertyType


        {
            if (field.isAnnotationPresent(PropertyType.class))
            {
                if (!field.get(schema).equals(property))
                {
                    PropertyType pt = field.getAnnotation(PropertyType.class);
                    if (pt.type() == Types.LangAlt)
                    {
                        // do not check method existence
                    }
                    else if (pt.type() == Types.Thumbnail && pt.card() == Cardinality.Alt)
                    {
                        // do not check method existence
                    }
                    else if (pt.type() == Types.ResourceRef)
                    {
                        // do not check method existence
                    }
                    else if (pt.type() == Types.Version && pt.card() == Cardinality.Seq)
                    {
                        // do not check method existence
                    }
                    else
                    {
                        // type test
                        PropertyType spt = retrievePropertyType(field.get(schema).toString());
                        String getNameProperty = "get" + prepareName(field.get(schema).toString(), spt) + "Property";
                        Method getMethod = schemaClass.getMethod(getNameProperty);
                        Assert.assertNull(getNameProperty + " should return null when testing " + property,
                                getMethod.invoke(schema));
                        // value test
View Full Code Here


        Field[] fields = schemaClass.getFields();
        for (Field field : fields)
        {
            if (field.isAnnotationPresent(PropertyType.class))
            {
                PropertyType pt = field.getAnnotation(PropertyType.class);
                if (field.get(schema).equals(prop))
                {
                    return pt;
                }
            }
View Full Code Here

                                    // all fields are mandatory
                                    throw new XmpParsingException(ErrorType.RequiredProperty,
                                            "Missing field in property definition");
                                }
                                // check ptype existance
                                PropertyType pt = transformValueType(tm, ptype);
                                if (pt.type() == null)
                                {
                                    throw new XmpParsingException(ErrorType.NoValueType, "Type not defined : " + ptype);
                                }
                                else if (pt.type().isSimple() || pt.type().isStructured()
                                        || pt.type() == Types.DefinedType)
                                {
                                    xsf.getPropertyDefinition().addNewProperty(pname, pt);
                                }
                                else
                                {
View Full Code Here

TOP

Related Classes of org.apache.xmpbox.type.PropertyType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.