private void addTransformAttribute(TransformAttribute attribute, Object result, Map<Integer, String> transformMap, Map<String, Object> attributes) { if (attribute == null) return; Object value = null; if (result != null) { value = transformMap.get(result); } else if (attribute.defaultValue().length() != 0) { value = attribute.defaultValue(); } attributes.put(attribute.value(), value); if (attribute.isSuper()) { addSuperAttribute(attribute.value(), value); } }
private void addAttribute(Attribute attribute, Object methodResult, Map<String, Object> attributes) { if (attribute == null) return; Object value = null; if (methodResult != null) { value = methodResult; } else if (attribute.defaultValue().length() != 0) { value = attribute.defaultValue(); } attributes.put(attribute.value(), value); if (attribute.isSuper()) { addSuperAttribute(attribute.value(), value); } }
private void addSuperAttributesFromParameters(Annotation[][] keys, Object[] values) { if (keys == null || values == null) { return; } for (int i = 0, size = keys.length; i < size; i++) { if (keys[i].length == 0) { continue; } Object value = values[i]; Annotation annotation = keys[i][0]; if (annotation instanceof Attribute) { Attribute attribute = (Attribute) annotation; Object result = null; if (value != null) { result = value; } else if (attribute.defaultValue().length() != 0) { result = attribute.defaultValue(); } addSuperAttribute(attribute.value(), result); } } }
private void addFixedAttribute(FixedAttribute attribute, Map<String, Object> attributes) { if (attribute == null) return; attributes.put(attribute.key(), attribute.value()); if (attribute.isSuper()) { addSuperAttribute(attribute.key(), attribute.value()); } }
private void addFixedAttributes(FixedAttributes fixedAttributes, Map<String, Object> attributes) { if (fixedAttributes == null) return; FixedAttribute[] attributeList = fixedAttributes.value(); for (FixedAttribute attribute : attributeList) { attributes.put(attribute.key(), attribute.value()); if (attribute.isSuper()) { addSuperAttribute(attribute.key(), attribute.value()); } } }
addSuperAttribute(attribute.value(), result); addSuperAttribute(transformAttribute.value(), result);