Package com.aspose.tasks
Annotation Type EntityFieldAttribute
-
@Target(METHOD) @Retention(RUNTIME) public @interface EntityFieldAttribute
Represents an attribute for entity properties.
How to enumerate properties using EntityField attribute:
[Java] Project project = new Project("sample.mpp"); for (Task task : project.selectAllChildTasks()) { System.out.println("Task:"); for (java.lang.reflect.Method method : Task.class.getMethods()) { if (method.isAnnotationPresent(EntityFieldAttribute.class) && method.getParameterCount() == 0) try { System.out.println(String.format("%s: %s", method.getName(), method.invoke(task))); } catch (IllegalAccessException e) { } catch (InvocationTargetException e) { } } }
Attribute used forTask
,Resource
,Project
andResourceAssignment
entity properties only, and simplifies it's enumeration.