| 1 |
|
package uk.co.badgersinfoil.asxsd.components; |
| 2 |
|
|
| 3 |
|
import org.eclipse.xsd.XSDAttributeGroupDefinition; |
| 4 |
|
import org.eclipse.xsd.XSDConcreteComponent; |
| 5 |
|
import uk.co.badgersinfoil.asxsd.CodegenContext; |
| 6 |
|
import uk.co.badgersinfoil.asxsd.CodegenRole; |
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
15 |
public class AttributeGroupReferenceComponent extends AbstractMappingComponent { |
| 11 |
|
|
| 12 |
|
public void generateCode(CodegenContext context, |
| 13 |
|
XSDConcreteComponent component) |
| 14 |
|
{ |
| 15 |
3 |
CodegenRole role = context.getCurrentRole(); |
| 16 |
3 |
context.generateCode(resolve(component)); |
| 17 |
3 |
} |
| 18 |
|
|
| 19 |
|
private static XSDAttributeGroupDefinition resolve(XSDConcreteComponent component) { |
| 20 |
3 |
return ((XSDAttributeGroupDefinition)component).getResolvedAttributeGroupDefinition(); |
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
public boolean willAccept(XSDConcreteComponent component) { |
| 24 |
61 |
return component instanceof XSDAttributeGroupDefinition |
| 25 |
|
&& ((XSDAttributeGroupDefinition)component).isAttributeGroupDefinitionReference(); |
| 26 |
|
} |
| 27 |
|
} |