EMF complex types missing setters

When EMF generates Java classes for complex types from XSD it only generates getters but not setters for attributes of the class.

This can be fixed by defining the setter method as an annotated operation.

Make sure your complex type has the following structure:

<xsd:complexType name=”ComplexTypeName”>
<xsd:annotation>
<xsd:appinfo ecore:key=”operations”
source=”http://www.eclipse.org/emf/2002/Ecore”>
<operation name=”setNameOfAttribute”>
<parameter name=”value” type=”ecore:EEList{?}” />
<body />
</operation>
<operation name=”setNameOfSecondAttribute”>
<parameter name=”value” type=”ecore:EEList{?}” />
<body />
</operation>

</xsd:appinfo>
<xsd:documentation>
Documentation on the purpose of your class
</xsd:documentation>
</xsd:annotation>
….
</xsd:complexType>

One Response to “EMF complex types missing setters”

  1. DONNIE says:


    Pillspot.org. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. Low price pills. Order drugs online

    Buy:SleepWell.Advair.Nymphomax.Cozaar.Amoxicillin.Zetia.Zocor.Buspar.Prozac.Aricept.Lipitor.Female Cialis.Seroquel.Wellbutrin SR.Lipothin.Female Pink Viagra.Ventolin.Acomplia.Lasix.Benicar….

Leave a Reply