| 1 |
|
package uk.co.badgersinfoil.asxsd.components; |
| 2 |
|
|
| 3 |
|
import java.util.Iterator; |
| 4 |
|
import java.util.List; |
| 5 |
|
import org.eclipse.xsd.XSDAttributeGroupDefinition; |
| 6 |
|
import org.eclipse.xsd.XSDAttributeUse; |
| 7 |
|
import org.eclipse.xsd.XSDConcreteComponent; |
| 8 |
|
import uk.co.badgersinfoil.asxsd.CodegenContext; |
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
15 |
public class AttributeGroupComponent extends AbstractMappingComponent { |
| 13 |
|
|
| 14 |
|
public void generateCode(CodegenContext context, |
| 15 |
|
XSDConcreteComponent component) |
| 16 |
|
{ |
| 17 |
3 |
XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)component; |
| 18 |
3 |
List attrUses = attrGroup.getAttributeUses(); |
| 19 |
3 |
for (Iterator i=attrUses.iterator(); i.hasNext(); ) { |
| 20 |
3 |
context.generateCode((XSDAttributeUse)i.next()); |
| 21 |
|
} |
| 22 |
|
|
| 23 |
3 |
} |
| 24 |
|
|
| 25 |
|
public boolean willAccept(XSDConcreteComponent component) { |
| 26 |
58 |
return component instanceof XSDAttributeGroupDefinition; |
| 27 |
|
} |
| 28 |
|
} |