@Override public boolean isValue(Object obj) { if (obj == null || obj instanceof CompositeValue == false) return false; return equalsImpl(((CompositeValue) obj).getMetaType()); }
@Override public boolean isValue(Object obj) { if (obj == null || obj instanceof CompositeValue == false) return false; return equalsImpl(((CompositeValue) obj).getMetaType()); }
/** * Validate the composite type against the row type * * @param value the composite value * @throws IllegalArgumentException for a null value or if the value is not valid for the table value's row type */ private void validateCompositeValue(CompositeValue value) { if (value == null) throw new IllegalArgumentException("null value"); if (value.getMetaType().equals(tableType.getRowType()) == false) throw new IllegalArgumentException("value has composite type " + value.getMetaType() + " expected row type " + tableType.getRowType()); }
/** * Validate the composite type against the row type * * @param value the composite value * @throws IllegalArgumentException for a null value or if the value is not valid for the table value's row type */ private void validateCompositeValue(CompositeValue value) { if (value == null) throw new IllegalArgumentException("null value"); if (value.getMetaType().equals(tableType.getRowType()) == false) throw new IllegalArgumentException("value has composite type " + value.getMetaType() + " expected row type " + tableType.getRowType()); }
protected Map unwrapCompositeMap(CompositeValue compositeValue) { HashMap map = new HashMap(); CompositeMetaType metaType = compositeValue.getMetaType(); for(String key : metaType.itemSet()) { MetaValue mv = compositeValue.get(key); Object value = unwrap(mv); map.put(key, value); } return map; }
@Override public ObjectName unwrapMetaValue(MetaValue metaValue) { CompositeValue cv = (CompositeValue) metaValue; String domain = null; Hashtable<String, String> props = new Hashtable<String, String>(); for(String key : cv.getMetaType().itemSet()) { SimpleValue svalue = (SimpleValue) cv.get(key); String value = (String) svalue.getValue(); if(key.equalsIgnoreCase("domain")) domain = value; else props.put(key, value); } try { ObjectName name = new ObjectName(domain, props); return name; } catch(Exception e) { throw new IllegalArgumentException("Failed to build ObjectName from MetaValue: "+metaValue, e); } }
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj == null || obj instanceof CompositeValue == false) return false; CompositeValue other = (CompositeValue) obj; if (getMetaType().equals(other.getMetaType()) == false) return false; for (String key : getMetaType().keySet()) { Object thisValue = this.get(key); Object otherValue = other.get(key); if ((thisValue == null && otherValue == null || thisValue != null && thisValue.equals(otherValue)) == false) return false; } return true; }
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj == null || obj instanceof CompositeValue == false) return false; CompositeValue other = (CompositeValue) obj; if (getMetaType().equals(other.getMetaType()) == false) return false; for (String key : getMetaType().keySet()) { Object thisValue = this.get(key); Object otherValue = other.get(key); if ((thisValue == null && otherValue == null || thisValue != null && thisValue.equals(otherValue)) == false) return false; } return true; }
/** * Create the persistence table value. * * @param value the table value * @param the persisted table * @return the persistence table xml meta data */ protected PersistedTableValue createTableValue(TableValue value) { PersistedTableValue table = new PersistedTableValue(); // Fix the entries List<PersistedCompositeValue> entries = table.getEntries(); if(entries == null) { entries = new ArrayList<PersistedCompositeValue>(); table.setEntries(entries); } // Process values Collection<CompositeValue> values = value.values(); for(CompositeValue entry : values) { entries.add(createCompositeValue(entry, entry.getMetaType())); } return table; }
Set<String> paramNames = paramsValue.getMetaType().keySet(); List<ProtocolParameter> protParams = new ArrayList<ProtocolParameter>(paramNames.size()); for (String paramName : paramNames)
for (String stack : topCompValue.getMetaType().keySet())
CompositeMetaType compositeMetaType = compositeValue.getMetaType(); String typeName = compositeMetaType.getTypeName(); ClassLoader cl;
protected Object unwrapComposite(CompositeValue compositeValue, TypeInfo typeInfo) CompositeMetaType compositeMetaType = compositeValue.getMetaType(); String typeName = compositeMetaType.getTypeName(); ClassLoader cl;