本文整理汇总了Java中com.alexrnl.commons.utils.object.ReflectUtils类的典型用法代码示例。如果您正苦于以下问题:Java ReflectUtils类的具体用法?Java ReflectUtils怎么用?Java ReflectUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReflectUtils类属于com.alexrnl.commons.utils.object包,在下文中一共展示了ReflectUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMember
import com.alexrnl.commons.utils.object.ReflectUtils; //导入依赖的package包/类
/**
* Create the string data that represent the member specified.
* @param member
* the member to write as a string, in the format specified.
* @param format
* the format to use.
* @return the new member or <code>null</code> if parsing failed.
*/
private static String createMember (final Member member, final Format format) {
final StringBuilder strRepresentation = new StringBuilder();
for (final Converter<MemberColumn> converter : format.getFieldOrder()) {
if (converter != null) {
final Object data;
// TODO add a case for boolean with the is prefix
final String methodName = ReflectUtils.GETTER_PREFIX + converter.getField().getFieldName();
try {
final Method method = Member.class.getMethod(methodName);
data = method.invoke(member);
} catch (SecurityException | NoSuchMethodException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
lg.warning("Error while calling method " + methodName + " in member class (" +
e.getClass() + "; " + e.getMessage() + ")");
return null;
}
strRepresentation.append(converter.write(data));
}
strRepresentation.append(format.getFieldSeparator());
}
return strRepresentation.toString();
}
示例2: fullStateEnumCoverage
import com.alexrnl.commons.utils.object.ReflectUtils; //导入依赖的package包/类
/**
* Trigger a full enum coverage on the {@link Type} enum.
*/
@Test
public void fullStateEnumCoverage () {
ReflectUtils.fullEnumCoverage(Type.class);
}
示例3: fullStateEnumCoverage
import com.alexrnl.commons.utils.object.ReflectUtils; //导入依赖的package包/类
/**
* Trigger a full enum coverage on the {@link Filter} enum.
*/
@Test
public void fullStateEnumCoverage () {
ReflectUtils.fullEnumCoverage(OrderType.class);
}
示例4: fullStateEnumCoverage
import com.alexrnl.commons.utils.object.ReflectUtils; //导入依赖的package包/类
/**
* Trigger a full enum coverage on the {@link Filter} enum.
*/
@Test
public void fullStateEnumCoverage () {
ReflectUtils.fullEnumCoverage(Filter.class);
}
示例5: fullStateEnumCoverage
import com.alexrnl.commons.utils.object.ReflectUtils; //导入依赖的package包/类
/**
* Trigger a full enum coverage on the {@link Verb} enum.
*/
@Test
public void fullStateEnumCoverage () {
ReflectUtils.fullEnumCoverage(Verb.class);
}
示例6: fullStateEnumCoverage
import com.alexrnl.commons.utils.object.ReflectUtils; //导入依赖的package包/类
/**
* Trigger a full enum coverage on the {@link Format} enum.
*/
@Test
public void fullStateEnumCoverage () {
ReflectUtils.fullEnumCoverage(Format.class);
}