/** Returns class name of value object.*/ final String getClassName() { if (obj != null) { Object modifObj = null; if (obj instanceof ModifiedAttribute) { modifObj = ((Attr) ((ModifiedAttribute) obj).getValue()).getValue(); } return (modifObj != null) ? modifObj.getClass().getName() : obj.getClass().getName(); } return null; }
final void maybeAddSerValueComment(PrintWriter pw, String indent) { if (obj != null) { Object modifObj = null; if (obj instanceof ModifiedAttribute) { modifObj = ((Attr) ((ModifiedAttribute) obj).getValue()).getValue(); if (distinguishObject(modifObj) != Attr.isValid("SERIALVALUE")) { //NOI18N return; } } // Important for debugging to know what this stuff really is. // Note this comment is only written to disk when the attr is // first saved; after that successive saves will just know the // ser value and will not print the comment. So look at .nbattrs // immediately after setting something serialized. --jglick pw.print(indent); pw.print("<!-- "); // NOI18N String s = (modifObj != null) ? modifObj.toString() : obj.toString(); if (s.indexOf("--") != -1) { // NOI18N // XML comment no-no. s = s.replace('-', '_'); // NOI18N } pw.print(s); pw.println(" -->"); // NOI18N } }
Object res = ((ModifiedAttribute) retVal).getValue(origAttrName);
final void maybeAddSerValueComment(PrintWriter pw, String indent) { if (obj != null) { Object modifObj = null; if (obj instanceof ModifiedAttribute) { modifObj = ((Attr)((ModifiedAttribute)obj).getValue ()).getValue (); if (distinguishObject (modifObj) != Attr.isValid("SERIALVALUE")) //NOI18N return; } // Important for debugging to know what this stuff really is. // Note this comment is only written to disk when the attr is // first saved; after that successive saves will just know the // ser value and will not print the comment. So look at .nbattrs // immediately after setting something serialized. --jglick pw.print(indent); pw.print("<!-- "); // NOI18N String s = (modifObj != null) ? modifObj.toString():obj.toString(); if (s.indexOf("--") != -1) { // NOI18N // XML comment no-no. s = s.replace('-', '_'); // NOI18N } pw.print(s); pw.println(" -->"); // NOI18N } }
private Object getAttribute (Object attrName, Object[] params) throws Exception { Attr attr; String origAttrName = (String)attrName; Object[] keyValuePair = ModifiedAttribute.translateInto((String)attrName,null); attrName = (String)keyValuePair[0]; synchronized (this) { attr = (Attr)map.get(attrName); } Object retVal = null; try { retVal = (attr == null)?attr : attr.get(params); } catch (Exception e) { ExternalUtil.annotate (e, "attrName = "+attrName); //NOI18N throw e; } if (retVal instanceof ModifiedAttribute) { Object res = ((ModifiedAttribute)retVal).getValue (origAttrName); if (res instanceof Attr) return ((Attr)res).get (params); else return res; } return retVal; }
final void maybeAddSerValueComment(PrintWriter pw, String indent) { if (obj != null) { Object modifObj = null; if (obj instanceof ModifiedAttribute) { modifObj = ((Attr)((ModifiedAttribute)obj).getValue ()).getValue (); if (distinguishObject (modifObj) != Attr.isValid("SERIALVALUE")) //NOI18N return; } // Important for debugging to know what this stuff really is. // Note this comment is only written to disk when the attr is // first saved; after that successive saves will just know the // ser value and will not print the comment. So look at .nbattrs // immediately after setting something serialized. --jglick pw.print(indent); pw.print("<!-- "); // NOI18N String s = (modifObj != null) ? modifObj.toString():obj.toString(); if (s.indexOf("--") != -1) { // NOI18N // XML comment no-no. s = s.replace('-', '_'); // NOI18N } pw.print(s); pw.println(" -->"); // NOI18N } }
private Object getAttribute (Object attrName, Object[] params) throws Exception { Attr attr; String origAttrName = (String)attrName; Object[] keyValuePair = ModifiedAttribute.translateInto((String)attrName,null); attrName = (String)keyValuePair[0]; synchronized (this) { attr = (Attr)map.get(attrName); } Object retVal = null; try { retVal = (attr == null)?attr : attr.get(params); } catch (Exception e) { ExternalUtil.annotate (e, "attrName = "+attrName); //NOI18N throw e; } if (retVal instanceof ModifiedAttribute) { Object res = ((ModifiedAttribute)retVal).getValue (origAttrName); if (res instanceof Attr) return ((Attr)res).get (params); else return res; } return retVal; }
final String getValueForPrint() { if (obj != null) { Attr modifAttr = null; if (obj instanceof ModifiedAttribute) modifAttr = (Attr)((ModifiedAttribute)obj).getValue (); return (modifAttr != null) ? encode(modifAttr.getValue ()) : encode(getValue ()); } return (value != null)?encode(value) : ""; // NOI18N }
/** ModifiedAttribute holds original value + modifiers. This method returns original value. * @return then returns original value */ Object getValue() { return getValue("");//NOI18N }
final String getKeyForPrint() { if (obj != null && obj instanceof ModifiedAttribute) { Attr modifAttr = (Attr)((ModifiedAttribute)obj).getValue (); int keyIdx = Attr.isValid ("SERIALVALUE");//NOI18N if (modifAttr != null) keyIdx = distinguishObject (modifAttr.getValue ()); String keyArray[] = getAttrTypes(); return keyArray[keyIdx]; } return getKey (); }
/** ModifiedAttribute holds original value + modifiers. This method returns original value. * @return then returns original value */ Object getValue() { return getValue("");//NOI18N }
final String getKeyForPrint() { if (obj != null && obj instanceof ModifiedAttribute) { Attr modifAttr = (Attr)((ModifiedAttribute)obj).getValue (); int keyIdx = Attr.isValid ("SERIALVALUE");//NOI18N if (modifAttr != null) keyIdx = distinguishObject (modifAttr.getValue ()); String keyArray[] = getAttrTypes(); return keyArray[keyIdx]; } return getKey (); }
final String getValueForPrint() { if (obj != null) { Attr modifAttr = null; if (obj instanceof ModifiedAttribute) modifAttr = (Attr)((ModifiedAttribute)obj).getValue (); return (modifAttr != null) ? encode(modifAttr.getValue ()) : encode(getValue ()); } return (value != null)?encode(value) : ""; // NOI18N }
/** ModifiedAttribute holds original value + modifiers. This method returns original value. * @return then returns original value */ Object getValue() { return getValue(""); //NOI18N }
final String getValueForPrint() { if (obj != null) { Attr modifAttr = null; if (obj instanceof ModifiedAttribute) { modifAttr = (Attr) ((ModifiedAttribute) obj).getValue(); } return (modifAttr != null) ? encode(modifAttr.getValue()) : encode(getValue()); } return (value != null) ? encode(value) : ""; // NOI18N }
final String getKeyForPrint() { if ((obj != null) && obj instanceof ModifiedAttribute) { Attr modifAttr = (Attr) ((ModifiedAttribute) obj).getValue(); int keyIdx = Attr.isValid("SERIALVALUE"); //NOI18N if (modifAttr != null) { keyIdx = distinguishObject(modifAttr.getValue()); } String[] keyArray = getAttrTypes(); return keyArray[keyIdx]; } return getKey(); }