}
@Override
public Void visitCollectionType(final CollectionType collectionType,
final AttributeMetaDesc attr) throws RuntimeException {
DataType elementType = collectionType.getElementType();
elementType.accept(
new SimpleDataTypeVisitor<Void, Void, RuntimeException>() {
@Override
public Void visitStringType(StringType type, Void p)
throws RuntimeException {
printer.println("/** */");
if (attr.isLob() || attr.isUnindexed()) {
printer
.println(
"public final %1$s<%2$s, %3$s> %4$s = new %1$s<%2$s, %3$s>(this, \"%5$s\", \"%4$s\", %6$s.class);",
StringCollectionUnindexedAttributeMeta,
modelMetaDesc.getModelClassName(),
collectionType.getTypeName(),
attr.getAttributeName(),
attr.getName(),
collectionType.getClassName());
} else {
printer
.println(
"public final %1$s<%2$s, %3$s> %4$s = new %1$s<%2$s, %3$s>(this, \"%5$s\", \"%4$s\", %6$s.class);",
StringCollectionAttributeMeta,
modelMetaDesc.getModelClassName(),
collectionType.getTypeName(),
attr.getAttributeName(),
attr.getName(),
collectionType.getClassName());
}
printer.println();
return null;
}
@Override
public Void visitCoreReferenceType(
CoreReferenceType elementType, Void p)
throws RuntimeException {
printer.println("/** */");
if (attr.isLob() || attr.isUnindexed()) {
printer
.println(
"public final %1$s<%2$s, %3$s, %4$s> %5$s = new %1$s<%2$s, %3$s, %4$s>(this, \"%6$s\", \"%5$s\", %7$s.class);",
CollectionUnindexedAttributeMeta,
modelMetaDesc.getModelClassName(),
collectionType.getTypeName(),
elementType.getTypeName(),
attr.getAttributeName(),
attr.getName(),
collectionType.getClassName());
} else {
printer
.println(
"public final %1$s<%2$s, %3$s, %4$s> %5$s = new %1$s<%2$s, %3$s, %4$s>(this, \"%6$s\", \"%5$s\", %7$s.class);",
CollectionAttributeMeta,
modelMetaDesc.getModelClassName(),
collectionType.getTypeName(),
elementType.getTypeName(),
attr.getAttributeName(),
attr.getName(),
collectionType.getClassName());
}
printer.println();