/* (non-Javadoc)
@see org.eclipse.datatools.connectivity.oda.IQuery#setObject(java.lang.String, java.lang.Object)
513297
public void setObject( String parameterName, Object value )
            throws OdaException
    {
        // only applies to named input parameter
		parameters.put(parameterName, value);
    }
1166470
public void setProperty(Object object, String property, Object newValue) {
        setProperty(theClass, object, property, newValue, false, false);
    }
1035422
@SuppressWarnings("unchecked") // Checked with instanceof
    public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(ID)) {
            if (obj instanceof CertificatePolicyId)
                policyIdentifier = (CertificatePolicyId)obj;
            else
                throw new IOException("Attribute value must be instance " +
                    "of CertificatePolicyId.");
        } else if (name.equalsIgnoreCase(QUALIFIERS)) {
            if (policyIdentifier == null) {
                throw new IOException("Attribute must have a " +
                    "CertificatePolicyIdentifier value before " +
                    "PolicyQualifierInfo can be set.");
            }
            if (obj instanceof Set) {
                Iterator<?> i = ((Set<?>)obj).iterator();
                while (i.hasNext()) {
                    Object obj1 = i.next();
                    if (!(obj1 instanceof PolicyQualifierInfo)) {
                        throw new IOException("Attribute value must be a" +
                                    "Set of PolicyQualifierInfo objects.");
                    }
                }
                policyQualifiers = (Set<PolicyQualifierInfo>) obj;
            } else {
                throw new IOException("Attribute value must be of type Set.");
            }
        } else {
            throw new IOException("Attribute name [" + name +
                "] not recognized by PolicyInformation");
        }
    }
260598
public <T> void setObject(DataKey<T> key, T object) {
        if (key == null) {
            throw new IllegalArgumentException("key must not be null");
        }
        if (object == null && !key.allowNull()) {
            throw new IllegalArgumentException("key \"" + key.getName() + "\" disallows null values but object was null");
        }
        data.put(key.getName(), object);
    }
1197294
public void setObject(int parameterIndex, Object x) throws SQLException {
    checkClosed();
    if (x == null) {
      setNull(parameterIndex, Types.OTHER);
    } else if (x instanceof UUID && connection.haveMinimumServerVersion(ServerVersion.v8_3)) {
      setUuid(parameterIndex, (UUID) x);
    } else if (x instanceof SQLXML) {
      setSQLXML(parameterIndex, (SQLXML) x);
    } else if (x instanceof String) {
      setString(parameterIndex, (String) x);
    } else if (x instanceof BigDecimal) {
      setBigDecimal(parameterIndex, (BigDecimal) x);
    } else if (x instanceof Short) {
      setShort(parameterIndex, (Short) x);
    } else if (x instanceof Integer) {
      setInt(parameterIndex, (Integer) x);
    } else if (x instanceof Long) {
      setLong(parameterIndex, (Long) x);
    } else if (x instanceof Float) {
      setFloat(parameterIndex, (Float) x);
    } else if (x instanceof Double) {
      setDouble(parameterIndex, (Double) x);
    } else if (x instanceof byte[]) {
      setBytes(parameterIndex, (byte[]) x);
    } else if (x instanceof java.sql.Date) {
      setDate(parameterIndex, (java.sql.Date) x);
    } else if (x instanceof Time) {
      setTime(parameterIndex, (Time) x);
    } else if (x instanceof Timestamp) {
      setTimestamp(parameterIndex, (Timestamp) x);
    } else if (x instanceof Boolean) {
      setBoolean(parameterIndex, (Boolean) x);
    } else if (x instanceof Byte) {
      setByte(parameterIndex, (Byte) x);
    } else if (x instanceof Blob) {
      setBlob(parameterIndex, (Blob) x);
    } else if (x instanceof Clob) {
      setClob(parameterIndex, (Clob) x);
    } else if (x instanceof Array) {
      setArray(parameterIndex, (Array) x);
    } else if (x instanceof PGobject) {
      setPGobject(parameterIndex, (PGobject) x);
    } else if (x instanceof Character) {
      setString(parameterIndex, ((Character) x).toString());
      //#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.2"
    } else if (x instanceof LocalDate) {
      setDate(parameterIndex, (LocalDate) x);
    } else if (x instanceof LocalTime) {
      setTime(parameterIndex, (LocalTime) x);
    } else if (x instanceof LocalDateTime) {
      setTimestamp(parameterIndex, (LocalDateTime) x);
    } else if (x instanceof OffsetDateTime) {
      setTimestamp(parameterIndex, (OffsetDateTime) x);
      //#endif
    } else if (x instanceof Map) {
      setMap(parameterIndex, (Map<?, ?>) x);
    } else if (x instanceof Number) {
      setNumber(parameterIndex, (Number) x);
    } else if (PrimitiveArraySupport.isSupportedPrimitiveArray(x)) {
      setPrimitiveArray(parameterIndex, x);
    } else {
      // Can't infer a type.
      throw new PSQLException(GT.tr(
          "Can''t infer the SQL type to use for an instance of {0}. Use setObject() with an explicit Types value to specify the type to use.",
          x.getClass().getName()), PSQLState.INVALID_PARAMETER_TYPE);
    }
  }
1087946
public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(KEY)) {
            this.key = (PublicKey)obj;
        } else {
            throw new IOException("Attribute name not recognized by " +
                                  "CertAttrSet: CertificateX509Key.");
        }
    }
292360
@java.lang.SuppressWarnings( { "ConstantConditions", "UnnecessaryBoxing" })
    public void setObject(int tagType, @NotNull Object value)
    {
        if (value == null)
            throw new NullPointerException("cannot set a null object");

        if (!_tagMap.containsKey(Integer.valueOf(tagType))) {
            _definedTagList.add(new Tag(tagType, this));
        }
//        else {
//            final Object oldValue = _tagMap.get(tagType);
//            if (!oldValue.equals(value))
//                addError(String.format("Overwritten tag 0x%s (%s).  Old=%s, New=%s", Integer.toHexString(tagType), getTagName(tagType), oldValue, value));
//        }
        _tagMap.put(tagType, value);
    }
1012273
public static void setProperty(Object obj, String prop, Object value) throws PageException {
	boolean done = false;
	try {
	    if (setField(obj, prop, value)) done = true;
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	}
	if (!done) callSetter(obj, prop, value);
    }
285075
public void setConnectionObjectID(int i)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setConnectionObjectID", ""+i);

      connectionObjectID = i;

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setConnectionObjectID");
   }
674265
public void setCurrentObject(Object obj) {
        if (((obj == null) && (this.nullString != null))
                || this.requiredType.isInstance(obj)
                || (obj instanceof String)
                || (obj instanceof File)
             //   || ((obj instanceof Task) && this.requiredType.isAssignableFrom(((Task) obj).getTaskResultType()))
                ) {
            this.currentValue = obj;
        } else {
            throw new IllegalArgumentException("Object not of required type.");
        }
    }
784701
static void setFieldValue(DBObject document, Object entityObject, Attribute column, boolean isLob)
    {
        Object value = null;

        if (document != null)
        {
            value = isLob ? ((DBObject) document.get("metadata")).get(((AbstractAttribute) column).getJPAColumnName())
                    : document.get(((AbstractAttribute) column).getJPAColumnName());
        }
        if (value != null)
        {
            Class javaType = column.getJavaType();
            try
            {
                switch (AttributeType.getType(javaType))
                {
                case MAP:
                    PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(),
                            ((BasicDBObject) value).toMap());
                    break;
                case SET:
                    List collectionValues = Arrays.asList(((BasicDBList) value).toArray());
                    PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(),
                            new HashSet(collectionValues));
                    break;
                case LIST:
                    PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(),
                            Arrays.asList(((BasicDBList) value).toArray()));
                    break;
                case POINT:

                    BasicDBList list = (BasicDBList) value;

                    Object xObj = list.get(0);
                    Object yObj = list.get(1);

                    if (xObj != null && yObj != null)
                    {
                        try
                        {
                            double x = Double.parseDouble(xObj.toString());
                            double y = Double.parseDouble(yObj.toString());

                            Point point = new Point(x, y);
                            PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(), point);
                        }
                        catch (NumberFormatException e)
                        {
                            log.error(
                                    "Error while reading geolocation data for column {} ; Reason - possible corrupt data, Caused by : .",
                                    column, e);
                            throw new EntityReaderException("Error while reading geolocation data for column " + column
                                    + "; Reason - possible corrupt data.", e);
                        }
                    }
                    break;
                case ENUM:
                    EnumAccessor accessor = new EnumAccessor();
                    value = accessor.fromString(javaType, value.toString());
                    PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(), value);
                    break;
                case PRIMITIVE:
                    value = MongoDBUtils.populateValue(value, value.getClass());
                    value = MongoDBUtils.getTranslatedObject(value, value.getClass(), javaType);
                    PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(), value);
                    break;
                }
            }
            catch (PropertyAccessException paex)
            {
                log.error("Error while setting column {} value, caused by : .",
                        ((AbstractAttribute) column).getJPAColumnName(), paex);
                throw new PersistenceException(paex);
            }
        }
    }
842818
@Override
	public void setObject(Serializable object) throws JMSException
    {
    	if (bodyIsReadOnly)
    		throw new MessageNotWriteableException("Message body is read-only");
    	
    	assertDeserializationLevel(MessageSerializationLevel.FULL);
    	
        if (object == null)
        {
            body = null;
            return;
        }
        
        try
        {
        	body = SerializationTools.toByteArray(object);
        }
        catch (Exception e)
        {
        	throw new FFMQException("Cannot serialize object message body","MESSAGE_ERROR",e);
        }
    }
1329076
public void setObjects(Map<String, Locator> objects) {
        this.objects.clear();
        if (objects != null) {
            this.objects.putAll(objects);
        }
    }
560149
public void addObject(final Object[] _row)
        throws SQLException
    {
        // store the ids also
        this.idList.add((Long) _row[0]);

        if (getFromSelect() != null) {
            final int column = "id".equals(this.valueSelect.getValueType())
                            ? this.valueSelect.getColIndexs().get(0) : 2;
            this.relIdList.add((Long) _row[column - 1]);
            // this means that it is a chained LinkFromSelect, but exclude
            // AttributeSets
            if (!getSelectParts().isEmpty() && getSelectParts().get(0) instanceof LinkFromSelect.LinkFromSelectPart
                            && !(((LinkFromSelect.LinkFromSelectPart) getSelectParts().get(0)).getType()
                                            instanceof AttributeSet)) {
                this.idList.set(this.idList.size() - 1, (Long) _row[1]);
            }
        }
        Object object = null;
        final AbstractValueSelect tmpValueSelect;
        if (this.valueSelect == null) {
            tmpValueSelect = this.fromSelect.getMainOneSelect().getValueSelect();
        } else {
            tmpValueSelect = this.valueSelect;
        }
        if (tmpValueSelect.getParentSelectPart() != null) {
            tmpValueSelect.getParentSelectPart().addObject(_row);
        }

        if (tmpValueSelect.getColIndexs().size() > 1) {
            final Object[] objArray = new Object[tmpValueSelect.getColIndexs().size()];
            int i = 0;
            for (final Integer colIndex : tmpValueSelect.getColIndexs()) {
                objArray[i] = _row[colIndex - 1];
                i++;
            }
            object = objArray;
        } else if (tmpValueSelect.getColIndexs().size() > 0) {
            object = _row[tmpValueSelect.getColIndexs().get(0) - 1];
        }
        this.objectList.add(object);
    }
231799
@Override
    public void setValue(Object value) {
        super.setValue(value);
        if (parent != null) {
            Object parentValue = parent.getValue();
            if (parentValue != null) {
                writeToObject(parentValue);
                parent.setValue(parentValue);
            }
        }
        if (value != null) {
            for (Property subProperty : subProperties) {
                subProperty.readFromObject(value);
            }
        }
    }
850432
@Override
    public Object set(int index, Object element) {
        if (clear) {
            throw new JeppettoException("set() after clear() not supported");
        }

        verifyOperation($set, BasicDBObject.class);

        return updates.put(prefix + index, DBObjectUtil.toDBObject(element));
    }
320657
public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(KEY_ID)) {
            if (!(obj instanceof KeyIdentifier)) {
              throw new IOException("Attribute value should be of" +
                                    " type KeyIdentifier.");
            }
            id = (KeyIdentifier)obj;
        } else {
          throw new IOException("Attribute name not recognized by " +
                "CertAttrSet:SubjectKeyIdentifierExtension.");
        }
        encodeThis();
    }