use of org.contextmapper.dsl.generator.mdsl.model.DataTypeAttribute in project context-mapper-dsl by ContextMapper.
the class MDSLDataTypeCreator method createAttributes4ReferencesList.
private List<DataTypeAttribute> createAttributes4ReferencesList(List<Reference> references) {
List<DataTypeAttribute> mdslAttributes = Lists.newArrayList();
for (Reference reference : references) {
DataType referencedType = createMDSLDataType(createComplexTypeForReference(reference));
mdslAttributes.add(createAttribute(reference.getName(), referencedType.getName(), isCollection(reference.getCollectionType()), reference.isNullable()));
}
return mdslAttributes;
}
use of org.contextmapper.dsl.generator.mdsl.model.DataTypeAttribute in project context-mapper-dsl by ContextMapper.
the class MDSLDataTypeCreator method createAttributes4ParameterList.
private List<DataTypeAttribute> createAttributes4ParameterList(List<Parameter> parameters) {
List<DataTypeAttribute> mdslAttributes = Lists.newArrayList();
for (Parameter parameter : parameters) {
DataType referencedType = createMDSLDataType(parameter.getParameterType());
mdslAttributes.add(createAttribute(parameter.getName(), referencedType.getName(), isCollection(parameter.getParameterType().getCollectionType()), false));
}
return mdslAttributes;
}
use of org.contextmapper.dsl.generator.mdsl.model.DataTypeAttribute in project context-mapper-dsl by ContextMapper.
the class MDSLDataTypeCreator method createAttribute.
private DataTypeAttribute createAttribute(String attributeName, String attributeType, boolean isCollection, boolean isNullable) {
DataTypeAttribute attribute = new DataTypeAttribute();
attribute.setName(mdslNameEncoder.encodeName(attributeName));
attribute.setType(mdslNameEncoder.encodeName(attributeType));
attribute.setIsCollection(isCollection);
attribute.setIsNullable(isNullable);
return attribute;
}
use of org.contextmapper.dsl.generator.mdsl.model.DataTypeAttribute in project context-mapper-dsl by ContextMapper.
the class MDSLDataTypeCreator method createAttributesForEnum.
private List<DataTypeAttribute> createAttributesForEnum(Enum enumm) {
List<DataTypeAttribute> attributes = new ArrayList<>();
for (EnumValue value : enumm.getValues()) {
DataTypeAttribute attribute = new DataTypeAttribute();
attribute.setName(mdslNameEncoder.encodeName(value.getName()));
attribute.setType(mdslNameEncoder.encodeName(enumm.getName()));
attributes.add(attribute);
}
return attributes;
}
Aggregations