class AbstractStructuredType extends AbstractComplexProperty
{

    protected static final String STRUCTURE_ARRAY_NAME = "li";

    private String namespace;

    private String preferedPrefix;

    private String prefix;

    public AbstractStructuredType(XMPMetadata metadata)
    {
        this(metadata, null, null, null);
    }

    public AbstractStructuredType(XMPMetadata metadata, String namespaceURI)
    {
        this(metadata, namespaceURI, null, null);
        StructuredType st = this.getClass().getAnnotation(StructuredType.class);
        if (st != null)
        {
            // init with annotation
            this.namespace = st.namespace();
            this.preferedPrefix = st.preferedPrefix();
        }
        else
        {
            throw new IllegalArgumentException(" StructuredType annotation cannot be null");
        }
        this.prefix = this.preferedPrefix;
    }

    public AbstractStructuredType(XMPMetadata metadata, String namespaceURI, String fieldPrefix, String propertyName)
    {
        super(metadata, propertyName);
        StructuredType st = this.getClass().getAnnotation(StructuredType.class);
        if (st != null)
        {
            // init with annotation
            this.namespace = st.namespace();
            this.preferedPrefix = st.preferedPrefix();
        }
        else
        {
            // init with parameters
            if (namespaceURI == null)
            {
                throw new IllegalArgumentException(
                        "Both StructuredType annotation and namespace parameter cannot be null");
            }
            this.namespace = namespaceURI;
            this.preferedPrefix = fieldPrefix;
        }
        this.prefix = fieldPrefix == null ? this.preferedPrefix : fieldPrefix;
    }

    /**
     * Get the namespace URI of this entity
     * 
     * @return the namespace URI
     */
    public final String getNamespace()
    {
        return namespace;
    }

    public final void setNamespace(String ns)
    {
        this.namespace = ns;
    }

    /**
     * Get the prefix of this entity
     * 
     * @return the prefix specified
     */
    public final String getPrefix()
    {
        return prefix;
    }

    public final void setPrefix(String pf)
    {
        this.prefix = pf;
    }

    public final String getPreferedPrefix()
    {
        return preferedPrefix;
    }

    protected void addSimpleProperty(String propertyName, Object value)
    {<FILL_FUNCTION_BODY>}

    protected String getPropertyValueAsString(String fieldName)
    {
        AbstractSimpleProperty absProp = (AbstractSimpleProperty) getProperty(fieldName);
        if (absProp == null)
        {
            return null;
        }
        else
        {
            return absProp.getStringValue();
        }
    }

    protected Calendar getDatePropertyAsCalendar(String fieldName)
    {
        DateType absProp = (DateType) getFirstEquivalentProperty(fieldName, DateType.class);
        if (absProp != null)
        {
            return absProp.getValue();
        }
        else
        {
            return null;
        }
    }

    public TextType createTextType(String propertyName, String value)
    {
        return getMetadata().getTypeMapping().createText(getNamespace(), getPrefix(), propertyName, value);
    }

    public ArrayProperty createArrayProperty(String propertyName, Cardinality type)
    {
        return getMetadata().getTypeMapping().createArrayProperty(getNamespace(), getPrefix(), propertyName, type);
    }

}

        TypeMapping tm = getMetadata().getTypeMapping();
        AbstractSimpleProperty asp = tm.instanciateSimpleField(getClass(), null, getPrefix(), propertyName, value);
        addProperty(asp);
    
<methods>public void <init>(org.apache.xmpbox.XMPMetadata, java.lang.String) ,public void addNamespace(java.lang.String, java.lang.String) ,public final void addProperty(org.apache.xmpbox.type.AbstractField) ,public Map<java.lang.String,java.lang.String> getAllNamespacesWithPrefix() ,public final List<org.apache.xmpbox.type.AbstractField> getAllProperties() ,public final org.apache.xmpbox.type.ArrayProperty getArrayProperty(java.lang.String) ,public final org.apache.xmpbox.type.ComplexPropertyContainer getContainer() ,public java.lang.String getNamespacePrefix(java.lang.String) ,public final org.apache.xmpbox.type.AbstractField getProperty(java.lang.String) ,public final void removeProperty(org.apache.xmpbox.type.AbstractField) <variables>private final non-sealed org.apache.xmpbox.type.ComplexPropertyContainer container,private final non-sealed Map<java.lang.String,java.lang.String> namespaceToPrefix