/** * Returns the accesor method related with the provided field * * @return MethodMetadata with the accesor method of the field */ public MethodMetadata getAccesorMethod(FieldMetadata field) { return accesorMethods.get(field.getFieldName()); }
/** * Returns the mutator method related with the provided field * * @return MethodMetadata with the mutator method of the field */ @Override public MethodMetadata getMutatorMethod(FieldMetadata field) { return mutatorMethods.get(field.getFieldName()); }
private boolean hasField(final List<? extends FieldMetadata> declaredFields, final FieldMetadata idField) { for (final FieldMetadata declaredField : declaredFields) { if (declaredField.getFieldName().equals(idField.getFieldName())) { return true; } } return false; }
public int compare(final FieldMetadata l, final FieldMetadata r) { return l.getFieldName().compareTo(r.getFieldName()); } });
private List<String> getFieldNamesOfRelationList( List<Pair<FieldMetadata, RelationInfo>> compositionRelation) { List<String> names = new ArrayList<String>(compositionRelation.size()); for (Pair<FieldMetadata, RelationInfo> pair : compositionRelation) { names.add(pair.getLeft().getFieldName().getSymbolName()); } return names; }
@Override public int compare(FieldMetadata field1, FieldMetadata field2) { return field1.getFieldName().getSymbolName() .compareTo(field2.getFieldName().getSymbolName()); } };
/** * Returns the mutator name for the given field. * * @param field the field used to determine the accessor name * @return the mutator method name */ public static JavaSymbolName getMutatorMethodName(final FieldMetadata field) { Validate.notNull(field, "Field metadata required"); return getMutatorMethodName(field.getFieldName()); }
private String getFinderParamPath(FinderParameter finderParameter, String entityVariable) { StringBuilder sbuilder = new StringBuilder(entityVariable); for (FieldMetadata field : finderParameter.getPath()) { sbuilder.append('.'); sbuilder.append(field.getFieldName().getSymbolName()); } return sbuilder.toString(); }
/** * Returns the accessor name for the given field. * * @param field the field to determine the accessor name * @return the accessor method name */ public static JavaSymbolName getAccessorMethodName(final FieldMetadata field) { Validate.notNull(field, "Field required"); return getAccessorMethodName(field.getFieldName(), field.getFieldType()); }
/** * Generate method name to use for add method of selected field * * @param field * @return */ private JavaSymbolName getAddMethodName(final FieldMetadata field) { final JavaSymbolName methodName = new JavaSymbolName(ADD_METHOD_PREFIX + StringUtils.capitalize(field.getFieldName().getSymbolName())); return methodName; }
/** * Generate method name to use for remove method of selected field * * @param field * @return */ private JavaSymbolName getRemoveMethodName(final FieldMetadata field) { final JavaSymbolName methodName = new JavaSymbolName(REMOVE_METHOD_PREFIX + StringUtils.capitalize(field.getFieldName().getSymbolName())); return methodName; }
public JavaSymbolName getEmbeddedIdMutator() { return new JavaSymbolName("set" + StringUtils.capitalize(embeddedIdField.getFieldName().getSymbolName())); }
public FieldMetadata getDeclaredField(final JavaSymbolName fieldName) { for (final FieldMetadata field : getDeclaredFields()) { if (field.getFieldName().equals(fieldName)) { return field; } } return null; }
protected MethodMetadata getMutatorMethod(final FieldMetadata field) { // Check if the mutator has been cached MethodMetadataBuilder mutator = mutatorMethods.get(field); if (mutator == null) { mutator = getMutatorMethod(field.getFieldName(), field.getFieldType()); mutatorMethods.put(field, mutator); } // Return governor method if (mutator == null) { return getGovernorMethod(BeanInfoUtils.getMutatorMethodName(field.getFieldName()), field.getFieldType()); } return mutator.build(); }
private FieldMetadataBuilder getIgnoreFieldFor(FieldMetadata field) { return new FieldMetadataBuilder(getId(), Modifier.PRIVATE, Arrays.asList(new AnnotationMetadataBuilder(JSON_IGNORE)), field.getFieldName(), field.getFieldType()); }
private FieldMetadataBuilder getDeseralizerFieldFor(FieldMetadata field, JavaType deserializer) { AnnotationMetadataBuilder annotation = new AnnotationMetadataBuilder(JSON_DESERIALIZE); annotation.addClassAttribute("using", deserializer); return new FieldMetadataBuilder(getId(), Modifier.PRIVATE, Arrays.asList(annotation), field.getFieldName(), field.getFieldType()); }
public FieldMetadataBuilder(final String declaredbyMetadataId, final FieldMetadata existing) { super(declaredbyMetadataId, existing); init(existing.getFieldName(), existing.getFieldType(), existing.getFieldInitializer()); this.commentStructure = existing.getCommentStructure(); }
public FieldMetadataBuilder(final FieldMetadata existing) { super(existing); init(existing.getFieldName(), existing.getFieldType(), existing.getFieldInitializer()); this.commentStructure = existing.getCommentStructure(); }
private void doModification(final FieldMetadata field, final CustomData customData) { final MemberHoldingTypeDetails memberHoldingTypeDetails = memberHoldingTypeDetailsMap.get(field.getDeclaredByMetadataId()); if (memberHoldingTypeDetails != null) { final FieldMetadata matchedField = memberHoldingTypeDetails.getField(field.getFieldName()); if (matchedField != null && !matchedField.getCustomData().keySet().containsAll(customData.keySet())) { final TypeDetailsBuilder typeDetailsBuilder = getTypeDetailsBuilder(memberHoldingTypeDetails); typeDetailsBuilder.addDataToField(field, customData); changed = true; } } }
protected EntityItem createEntityItem(JpaEntityMetadata entityMetadata, ViewContext<T> ctx, String suffix) { String versionFieldName = null; if (entityMetadata.getCurrentVersionField() != null) { versionFieldName = entityMetadata.getCurrentVersionField().getFieldName().getSymbolName(); } return new EntityItem(ctx.getEntityName(), ctx.getIdentifierField(), ctx.getControllerPath(), suffix, entityMetadata.isReadOnly(), versionFieldName); }