if (!component.getSubComponents().isEmpty()) {
throw new IllegalArgumentException(
"Sub-components are not supported yet for component "
+ component.getXmltag());
}
EAttribute result = EcoreFactory.eINSTANCE.createEAttribute();
result.setName(toJavaName(component.getXmltag(), false));
result.setLowerBound(component.isRequired() ? 1 : 0);
result.setUpperBound(1);
result.setEType(toEType(component.getTypeClass()));
annotate(result, "truncable", String.valueOf(component.isTruncatable()));
annotate(result, "required", String.valueOf(component.isRequired()));
annotate(result, ANNOTATION_TYPE_KEY, SmooksMetadata.COMPONENT_TYPE);
annotateValueNode(result, component);
addMappingInformation(result, component);