*
* @return The metadata bits
*/
public int getMethodMetadata(JavaClass javaClass, JavaMethod method) {
int retVal = getMethodType(method);
EjbBeanTag beanTag = (EjbBeanTag) javaClass.getTagByName(TagLibrary.EJB_BEAN);
DocletTag tag;
if ((tag = method.getTagByName(TagLibrary.EJB_PERSISTENCE_FIELD)) != null) {
if ((method.isPropertyAccessor() /*|| method.isPropertyMutator()*/)) {
retVal |= METADATA_METHOD_PERSISTENCE_FIELD;
} else {
if (log.isWarnEnabled()) {
log.warn("Ignoring " + TagLibrary.EJB_PERSISTENCE_FIELD + " tag. It should be place on property accessor. " + // or property mutator." +
method.getDeclarationSignature(true) + " - " + EjbUtils.tagToString(tag));
}
}
} else if ((tag = method.getTagByName(TagLibrary.EJB_RELATION)) != null) {
// METADATA_METHOD_RELATION_FIELD isn't compatible with METADATA_METHOD_PERSISTENCE_FIELD ??
if (method.isPropertyAccessor()) {
retVal |= METADATA_METHOD_RELATION_FIELD;
// TODO: Is METADATA_METHOD_RELATION_FIELD compatible with METADATA_METHOD_PERSISTENCE_FIELD ??
} else {
if (log.isWarnEnabled()) {
log.warn("Ignoring " + TagLibrary.EJB_RELATION + " tag. It should be place on property accessor." +
method.getDeclarationSignature(true) + " - " + EjbUtils.tagToString(tag));
}
}
}
if (beanTag != null && beanTag.getPrimkeyField() != null) {
BeanProperty prop = javaClass.getBeanProperty(beanTag.getPrimkeyField());
try {
if (prop == null || prop.getAccessor() == null) {
throw getErrorWithTagLocation(beanTag,
"Could not find getter for prim-key-field: " + beanTag.getPrimkeyField());
}
// Ok, now this must be that accessor for the key
if (method == prop.getAccessor()) {
retVal |= METADATA_METHOD_PRIMARY_KEY_FIELD;