/** This method looks for modifiers in attribute name (currently transient:). * * @param attrName original name of attribute * @param value original value - can be null * @return Object array with size 2. * If there are no modifiers in attribute name, then is returned Object array with * , where first is placed unchanged attribute name, and then uchanged value. * If there are modifiers in attribute name, then as attribute name is returned * stripped original attribute name (without modifiers) and ModifiedAttribute object, * that wraps original object and also contain modifiers. */ static Object[] translateInto(String attrName, Object value) { String newAttrName = attrName; Object newValue = value; ModifiedAttribute attr = null; for (int i = 0; i < fragments.length; i++) { String fragment = fragments[i]; int idx = newAttrName.indexOf(fragment); if (idx != -1) { /** fragment is cleared away */ newAttrName = newAttrName.substring(0, idx) + newAttrName.substring(idx + fragment.length()); if (attr == null) { newValue = attr = new ModifiedAttribute(value); } attr.modifier |= (1 << i); //set modifier } } return new Object[] { newAttrName, newValue }; }
newValue = attr = new ModifiedAttribute(value);
newValue = attr = new ModifiedAttribute(value);