@SuppressWarnings("unchecked") @Override public Collection<String> getKeywords() { return module.get(Collection.class, CodegenModule.KEYWORDS); }
/** * Set the name suffix * * @param suffix */ public void setNameSuffix(String suffix) { codegenModule.bind(CodegenModule.SUFFIX, suffix); }
@SuppressWarnings("unchecked") public AbstractDomainExporter(String namePrefix, String nameSuffix, File targetFolder, SerializerConfig serializerConfig, Charset charset) { this.targetFolder = targetFolder; this.serializerConfig = serializerConfig; this.charset = charset; CodegenModule module = new CodegenModule(); module.bind(CodegenModule.PREFIX, namePrefix); module.bind(CodegenModule.SUFFIX, nameSuffix); module.bind(CodegenModule.KEYWORDS, Constants.keywords); this.queryTypeFactory = module.get(QueryTypeFactory.class); this.typeMappings = module.get(TypeMappings.class); this.embeddableSerializer = module.get(EmbeddableSerializer.class); this.entitySerializer = module.get(EntitySerializer.class); this.supertypeSerializer = module.get(SupertypeSerializer.class); this.variableNameFunction = module.get(Function.class, CodegenModule.VARIABLE_NAME_FUNCTION_CLASS); }
@Override protected void configure() { super.configure(); bind(NamingStrategy.class, DefaultNamingStrategy.class); bind(Configuration.class, new Configuration(SQLTemplates.DEFAULT)); bind(Serializer.class, MetaDataSerializer.class); bind(QueryTypeFactory.class, SQLQueryTypeFactory.class); bind(BEAN_SERIALIZER, (Class<?>) null); bind(INNER_CLASSES_FOR_KEYS, false); bind(BEAN_PREFIX, ""); bind(BEAN_SUFFIX, ""); bind(BEAN_PACKAGE_NAME, "com.example"); bind(PACKAGE_NAME, "com.example"); bind(BEAN_SERIALIZER, (Class<?>) null); bind(SCHEMA_TO_PACKAGE, false); bindInstance(ENTITYPATH_TYPE, RelationalPathBase.class); bind(COLUMN_COMPARATOR, null); }
@Override public TypeMappings getTypeMappings() { return module.get(TypeMappings.class); }
/** * Set the typemappings class to be used * * @param typeMappingsClass */ public void setTypeMappingsClass(Class<? extends TypeMappings> typeMappingsClass) { codegenModule.bind(TypeMappings.class, typeMappingsClass); }
@Override public QueryTypeFactory getQueryTypeFactory() { return module.get(QueryTypeFactory.class); }
/** * Set the keywords to be used * * @param keywords */ public void setKeywords(Collection<String> keywords) { codegenModule.bind(CodegenModule.KEYWORDS, keywords); }
@Override public Serializer getDTOSerializer() { return module.get(ProjectionSerializer.class); }
/** * Set the name prefix * * @param prefix */ public void setNamePrefix(String prefix) { codegenModule.bind(CodegenModule.PREFIX, prefix); }
@Override public Serializer getEntitySerializer() { return module.get(EntitySerializer.class); }
/** * Set the serializer class to be used * * @param serializerClass */ public void setSerializerClass(Class<? extends Serializer> serializerClass) { codegenModule.bind(serializerClass); this.serializerClass = serializerClass; }
@Override public Serializer getSupertypeSerializer() { return module.get(SupertypeSerializer.class); }
/** * Set the package suffix * * @param suffix */ public void setPackageSuffix(String suffix) { codegenModule.bind(CodegenModule.PACKAGE_SUFFIX, suffix); }
@Override public Serializer getEmbeddableSerializer() { return module.get(EmbeddableSerializer.class); }
public void setNameSuffix(String nameSuffix) { module.bind(CodegenModule.SUFFIX, nameSuffix); }
@Override public String getNamePrefix() { return module.get(String.class, "prefix"); }
public void setNamePrefix(String namePrefix) { module.bind(CodegenModule.PREFIX, namePrefix); }
@Override public String getNameSuffix() { return module.get(String.class, CodegenModule.SUFFIX); }
@Override protected void configure() { bind(TypeMappings.class, JavaTypeMappings.class); bind(QueryTypeFactory.class, QueryTypeFactoryImpl.class); bind(EntitySerializer.class); bind(EmbeddableSerializer.class); bind(ProjectionSerializer.class); bind(SupertypeSerializer.class); // configuration for QueryTypeFactory bind(PREFIX, "Q"); bind(SUFFIX, ""); bind(PACKAGE_SUFFIX, ""); bind(KEYWORDS, Collections.<String>emptySet()); bind(IMPORTS, Collections.<String>emptySet()); bind(VARIABLE_NAME_FUNCTION_CLASS, DefaultVariableNameFunction.INSTANCE); }