private boolean _isKey() { Element e = getAnnotation(Element.class); if(e!=null && e.key()) return true; Attribute a = getAnnotation(Attribute.class); return a != null && a.key(); }
@Override public boolean primary() { return attr.key(); }
public boolean key() { return mAttribute.key(); }
public boolean primary() { return attr.key(); }
@Override public boolean optional() { return !attr.key(); }
@Override public boolean optional() { return !attr.key(); }
public boolean optional() { return !attr.key(); }
@Override public boolean primary() { return attr.key(); }
public String getNameForConfigBean(Object configBean, Class configBeanType) throws InvocationTargetException, IllegalAccessException { if (configBean instanceof Named) { Named nme = (Named) configBean; return nme.getName(); } if (configBean instanceof Resource) { Resource res = (Resource) configBean; return res.getIdentity(); } Method[] methods = configBeanType.getMethods(); for (Method method : methods) { Attribute attributeAnnotation = method.getAnnotation(Attribute.class); if ((attributeAnnotation != null) && attributeAnnotation.key()) { return (String) method.invoke(configBean); } } return null; }
private boolean _isKey() { Element e = getAnnotation(Element.class); if(e!=null && e.key()) return true; Attribute a = getAnnotation(Attribute.class); return a != null && a.key(); }
public static DescriptorSupport descriptor(final AttributeMethodInfo info) { final DescriptorSupport d = new DescriptorSupport(); final Attribute a = info.attribute(); d.setField(DESC_KIND, Attribute.class.getName()); if (!a.defaultValue().equals("\u0000")) { d.setField(DESC_DEFAULT_VALUE, a.defaultValue()); } d.setField(DESC_KEY, a.key()); d.setField(DESC_REQUIRED, a.required()); d.setField(DESC_REFERENCE, a.reference()); d.setField(DESC_VARIABLE_EXPANSION, a.variableExpansion()); d.setField(DESC_DATA_TYPE, info.inferDataType().getName()); return d; }