public static FunctionMirror newInstance(ExecutableElement method, ProcessingEnvironment env) { assertNotNull(env); AnnotationMirror annotationMirror = ElementUtil.getAnnotationMirror(method, Function.class, env); if (annotationMirror == null) { return null; } FunctionMirror result = new FunctionMirror(annotationMirror, method.getSimpleName().toString()); for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : env.getElementUtils().getElementValuesWithDefaults(annotationMirror).entrySet()) { String name = entry.getKey().getSimpleName().toString(); AnnotationValue value = entry.getValue(); if ("catalog".equals(name)) { result.catalog = value; } else if ("schema".equals(name)) { result.schema = value; } else if ("name".equals(name)) { result.name = value; } else if ("queryTimeout".equals(name)) { result.queryTimeout = value; } else if ("mapKeyNaming".equals(name)) { result.mapKeyNaming = value; } else if ("ensureResultMapping".equals(name)) { result.ensureResultMapping = value; } } return result; }
public static boolean isEqual(Object object, AnnotationValue value) { assertNotNull(object); if (value == null) { return false; } return object.equals(value.getValue()); }
public DomainTypeGenerator( ProcessingEnvironment env, TypeElement domainElement, DomainMeta domainMeta) throws IOException { super(env, domainElement, null, null, Constants.METATYPE_PREFIX, ""); assertNotNull(domainMeta); this.domainMeta = domainMeta; this.typeName = TypeMirrorUtil.getTypeName(domainMeta.getType(), env); this.metaTypeName = MetaUtil.getMetaTypeName(typeName); this.simpleMetaTypeName = MetaUtil.getSimpleMetaTypeName(typeName); this.typeParamDecl = makeTypeParamDecl(typeName); }
public void setElements(Iterable<ELEMENT> elements) { assertNotNull(elements); if (elements instanceof Collection<?>) { this.elements = new ArrayList<ELEMENT>((Collection<ELEMENT>) elements); } else { this.elements = new ArrayList<ELEMENT>(); for (ELEMENT element : elements) { this.elements.add(element); } } this.sqls = new ArrayList<PreparedSql>(this.elements.size()); }
public static <T> T invoke(Method method, Object target, Object... params) throws WrapException { assertNotNull(method); try { @SuppressWarnings("unchecked") T result = (T) method.invoke(target, params); return result; } catch (IllegalArgumentException e) { throw new WrapException(e); } catch (IllegalAccessException e) { throw new WrapException(e); } catch (InvocationTargetException e) { throw new WrapException(e); } }
public static EntityMirror newInstance(TypeElement clazz, ProcessingEnvironment env) { assertNotNull(env); AnnotationMirror annotationMirror = ElementUtil.getAnnotationMirror(clazz, Entity.class, env); if (annotationMirror == null) { return null; } EntityMirror result = new EntityMirror(annotationMirror); for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : env.getElementUtils().getElementValuesWithDefaults(annotationMirror).entrySet()) { String name = entry.getKey().getSimpleName().toString(); AnnotationValue value = entry.getValue(); if ("listener".equals(name)) { result.listener = value; } else if ("naming".equals(name)) { result.naming = value; } else if ("immutable".equals(name)) { result.immutable = value; } } return result; }
public PreparedSqlBuilder(Config config, SqlKind kind) { assertNotNull(config, kind); this.config = config; this.kind = kind; this.formattingFunction = new ConvertToLogFormatFunction(); }
protected FunctionMirror(AnnotationMirror annotationMirror, String defaltName) { assertNotNull(annotationMirror, defaltName); this.annotationMirror = annotationMirror; this.defaultName = defaltName; }
public TableIdGeneratorMeta(TableGeneratorMirror tableGeneratorMirror) { assertNotNull(tableGeneratorMirror); this.tableGeneratorMirror = tableGeneratorMirror; }
protected AutoModifyQuery(EntityType<E> entityType) { AssertionUtil.assertNotNull(entityType); this.entityType = entityType; }
@Override public void prepare() { super.prepare(); assertNotNull(method, sqlFilePath, parameterName, elements, sqls); }
protected SqlFileBatchModifyQuery(Class<ELEMENT> elementClass, SqlKind kind) { assertNotNull(elementClass, kind); this.elementClass = elementClass; this.kind = kind; }
public ExternalDomainMeta(TypeElement typeElement) { assertNotNull(typeElement); this.typeElement = typeElement; }