| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
package uk.co.badgersinfoil.asxsd.components; |
| 6 |
|
|
| 7 |
|
import org.eclipse.xsd.XSDConcreteComponent; |
| 8 |
|
import uk.co.badgersinfoil.asxsd.CodegenContext; |
| 9 |
|
import uk.co.badgersinfoil.asxsd.CodegenRole; |
| 10 |
|
import uk.co.badgersinfoil.asxsd.MappingFunction; |
| 11 |
|
import uk.co.badgersinfoil.asxsd.MappingComponent; |
| 12 |
|
import uk.co.badgersinfoil.asxsd.TypeDescriptor; |
| 13 |
|
import uk.co.badgersinfoil.asxsd.XSDUtils; |
| 14 |
|
import uk.co.badgersinfoil.metaas.dom.ASCompilationUnit; |
| 15 |
|
import uk.co.badgersinfoil.metaas.dom.ASExpression; |
| 16 |
|
import uk.co.badgersinfoil.metaas.dom.ASMethod; |
| 17 |
|
|
| 18 |
|
|
| 19 |
461 |
public abstract class AbstractMappingComponent implements MappingComponent { |
| 20 |
|
|
| 21 |
|
public void generateCode(CodegenContext context, |
| 22 |
|
XSDConcreteComponent component) |
| 23 |
|
{ |
| 24 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 25 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation generateCode(role="+role+", component="+component+") at "+XSDUtils.path(component)); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
public TypeDescriptor typeDescriptorFor(CodegenContext context, |
| 29 |
|
XSDConcreteComponent component) |
| 30 |
|
{ |
| 31 |
293 |
return context.getOrCreateType(component); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
public TypeDescriptor createTypeDescriptor(CodegenContext context, |
| 35 |
|
XSDConcreteComponent component) |
| 36 |
|
{ |
| 37 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 38 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation createTypeDescriptor(role="+role+", component="+component+") at "+XSDUtils.path(component)); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
public String createTypeNameFor(CodegenContext context, |
| 42 |
|
XSDConcreteComponent component) |
| 43 |
|
{ |
| 44 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 45 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation createTypeNameFor(role="+role+") at "+XSDUtils.path(component)); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public MappingFunction createFunctionRef(CodegenContext context, |
| 49 |
|
XSDConcreteComponent component) |
| 50 |
|
{ |
| 51 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 52 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation createFunctionRef(role="+role+") at "+XSDUtils.path(component)); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
public ASMethod createFunction(CodegenContext context, |
| 56 |
|
XSDConcreteComponent component) |
| 57 |
|
{ |
| 58 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 59 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation createFunction(role="+role+") at "+XSDUtils.path(component)); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public ASCompilationUnit createType(CodegenContext context, XSDConcreteComponent component) { |
| 63 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 64 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation createType(role="+role+") at "+XSDUtils.path(component)); |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
public ASExpression createExpression(CodegenContext context, |
| 68 |
|
XSDConcreteComponent component) |
| 69 |
|
{ |
| 70 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 71 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation createExpression(role="+role+") at "+XSDUtils.path(component)); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
public MappingFunction functionFor(CodegenContext context, XSDConcreteComponent component) { |
| 75 |
45 |
return context.getOrCreateFunction(component); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
public String variableNameFor(CodegenContext context, |
| 79 |
|
XSDConcreteComponent component) |
| 80 |
|
{ |
| 81 |
0 |
CodegenRole role = context.getCurrentRole(); |
| 82 |
0 |
throw new RuntimeException(getClass().getName()+" does not suppport operation variableNameFor(role="+role+") at "+XSDUtils.path(component)); |
| 83 |
|
} |
| 84 |
|
} |