Marshall the attribute with attribute Value

@param attribute attribute to marshall
@return result of the marshall action
@throws fr.esrf.Tango.DevFailed if marshall action failed
160746
static byte[] marshallIDL4(final AttributeImpl attribute) throws DevFailed {
        XLOGGER.entry();
        final AttributeValue_4 attributeValue = TangoIDLAttributeUtil.toAttributeValue4(attribute,
                attribute.getReadValue(), attribute.getWriteValue());
        return marshallIDL4(attributeValue);
    }
1118168
@Override
    public Map<String, String[]> getAttributeProperties(final String deviceName, final String attributeName)
            throws DevFailed {
        Map<String, String[]> map;
        final DeviceData argin = new DeviceData();
        final List<String> args = new ArrayList<String>();
        args.add(deviceName);
        args.add(attributeName);
        // value is an array
        argin.insert(args.toArray(new String[args.size()]));
        final DeviceData argout = database.command_inout("DbGetDeviceAttributeProperty2", argin);
        final String[] result = argout.extractStringArray();
        map = extractArgout(result, 4);
        return map;

    }
75092
@SuppressWarnings("unchecked")
	static <T> T getAttribute(ObjectName name, String attribute) throws JMException {
		return (T) MBEAN_SERVER.getAttribute(name, attribute);
	}
152162
public static void set_value(final Object value, final Attribute attribute) throws DevFailed {
	try {

	    if (value instanceof Short) {
		attribute.set_value(((Short) value).shortValue());
	    } else if (value instanceof Byte) {
		attribute.set_value(((Byte) value).shortValue());
	    } else if (value instanceof String) {
		attribute.set_value((String) value);
	    } else if (value instanceof Integer) {
		attribute.set_value(((Integer) value).intValue());
	    } else if (value instanceof Long) {
		attribute.set_value(((Long) value).longValue());
	    } else if (value instanceof Float) {
		attribute.set_value(((Float) value).doubleValue());
	    } else if (value instanceof Boolean) {
		attribute.set_value(((Boolean) value).booleanValue());
	    } else if (value instanceof Double) {
		attribute.set_value(((Double) value).doubleValue());
	    } else if (value instanceof DevState) {
		attribute.set_value((DevState) value);
	    } else {
		// System.out.println(value.getClass().getName());
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type " + value.getClass()
			+ " not supported",
			"AttributeHelper.insert(Object value,deviceAttributeWritten)");
	    }
	} catch (final Exception e) {
	    e.printStackTrace();
	}
    }
713953
@Override
    public List<Object> getAttributeValues(final String name) {
        final List<Object> values = this.attributes.get(name);
        if (values == null) {
            return null;
        }

        return values;
    }
392400
private static final BagAttribute getAttributeFromEvaluationResult(EvaluationResult attribute) {
        if (attribute.indeterminate()) {
            return null;
        }

        if (attribute.getStatus() != null
                && !Status.STATUS_OK.equals(attribute.getStatus())) {
            return null;
        }

        AttributeValue attributeValue = attribute.getAttributeValue();
        if (!(attributeValue instanceof BagAttribute)) {
            return null;
        }

        return (BagAttribute) attributeValue;
    }
1042452
public Object getAttribute(String attributeName) {
    try {
      final int index = Integer.parseInt(attributeName) - 1;
      if (index < reportable.getMaxEntriesToKeep()) {
        return reportable.get(index).getValue();
      }
    } catch (NumberFormatException e) {
      LOGGER.error("Should never happen! Requested attribute should be an integer but was: " + attributeName);
    }
    return null;
  }
890076
public Attribute getAttribute(String name)
  {
    for (int i = _attributes.size() - 1; i >= 0; i--) {
      Attribute attr = _attributes.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
828515
private String readAttributeAsString(Attribute attribute) throws UnsupportedKerasConfigurationException {
        synchronized (Hdf5Archive.LOCK_OBJECT) {
            VarLenType vl = attribute.getVarLenType();
            int bufferSizeMult = 1;
            String s = null;
            /* TODO: find a less hacky way to do this.
             * Reading variable length strings (from attributes) is a giant
             * pain. There does not appear to be any way to determine the
             * length of the string in advance, so we use a hack: choose a
             * buffer size and read the config, increase buffer and repeat
             * until the buffer ends with \u0000
             */
            while (true) {
                byte[] attrBuffer = new byte[bufferSizeMult * 2000];
                BytePointer attrPointer = new BytePointer(attrBuffer);
                attribute.read(vl, attrPointer);
                attrPointer.get(attrBuffer);
                s = new String(attrBuffer);

                if (s.endsWith("\u0000")) {
                    s = s.replace("\u0000", "");
                    break;
                }

                bufferSizeMult++;
                if (bufferSizeMult > 1000) {
                    throw new UnsupportedKerasConfigurationException("Could not read abnormally long HDF5 attribute");
                }
            }
            vl.deallocate();
            return s;
        }
    }
1254695
public AttributeValue[] read_attributes(final String[] names) throws DevFailed {
	Util.out4.println("DeviceImpl.read_attributes arrived" + names[0]);

	// Record operation request in black box
	blackbox.insert_op(Op_Read_Attr);

	// Return exception if the device does not have any attribute
	if (dev_attr.get_attr_nb() == 0) {
	    Except.throw_exception("API_AttrNotFound", "The device does not have any attribute",
		    "DeviceImpl.read_attributes");
	}

	// Build a sequence with the names of the attribute to be read.
	// This is necessary in case of the "AllAttr" shortcut is used
	// If all attributes are wanted, build this list
	final String[] real_names = checkRealNames(names);

	// If nb connection is closed to the maximum value,
	// throw an exception to do not block devices.
	Util.increaseAccessConter();
	if (Util.getAccessConter() > Util.getPoaThreadPoolMax() - 2) {
	    Util.decreaseAccessConter();
	    Except.throw_exception("API_MemoryAllocation", Util.instance().get_ds_real_name()
		    + ": No thread available to connect device", "DeviceImpl.read_attributes()");
	}

	final Vector wanted_attr = new Vector();
	final Vector wanted_w_attr = new Vector();
	AttributeValue[] back = null;
	try {
	    switch (Util.get_serial_model()) {
	    case BY_CLASS:
		synchronized (device_class) {
		    sortAttributes(real_names, wanted_attr, wanted_w_attr);
		    back = manageReadAttrinbute(real_names, wanted_attr, wanted_w_attr);
		}
		break;

	    case BY_DEVICE:
		synchronized (this) {
		    sortAttributes(real_names, wanted_attr, wanted_w_attr);
		    back = manageReadAttrinbute(real_names, wanted_attr, wanted_w_attr);
		}
		break;

	    default: // NO_SYNC
		synchronized (this) {
		    sortAttributes(real_names, wanted_attr, wanted_w_attr);
		}
		back = manageReadAttrinbute(real_names, wanted_attr, wanted_w_attr);
	    }
	} // End of try

	catch (final DevFailed exc) {
	    Util.decreaseAccessConter();
	    setNotActive(real_names);
	    throw exc;
	} catch (final Exception exc) {
	    Util.decreaseAccessConter();
	    setNotActive(real_names);
	    exc.printStackTrace();
	    Except.throw_exception("API_ExceptionCatched", exc.toString(),
		    "DeviceImpl.read_attributes");
	}

	Util.decreaseAccessConter();
	setNotActive(real_names);

	// Return to caller
	Util.out4.println("Leaving DeviceImpl.read_attributes");
	return back;
    }
613290
protected void checkAttribute(String attribute) {
        if (!hasAttribute(attribute)) {
            String sb = "Attribute: '" + attribute + "' is not defined in model: '" + getModelClass() + ". "
                    + "Available attributes: " +getAttributeNames();
            throw new IllegalArgumentException(sb);
        }
    }
693488
public static boolean isHaveAttribute(AttributeSet attrs, String attribute) {
        return attrs.getAttributeValue(Ui.androidStyleNameSpace, attribute) != null;
    }
589340
@Nullable
  public final synchronized Object getAttribute(String view, String attribute) {
    if (attributes == null) {
      return null;
    }
    return attributes.get(view, attribute);
  }
881980
public void poll_attribute(final DeviceProxy deviceProxy, final String attname, final int period)
	    throws DevFailed {
    	poll_object(deviceProxy, attname, "attribute", period);
    }
313408
private void sortAttributes(final String[] names, final Vector wanted_attr,
	    final Vector wanted_w_attr) throws DevFailed {
	for (final String name : names) {
	    final Attribute att = dev_attr.get_attr_by_name(name);
	    final int att_idx = dev_attr.get_attr_ind_by_name(name);

	    if (att.get_writable() == AttrWriteType.READ_WRITE) {
		wanted_w_attr.addElement(att_idx);
		wanted_attr.addElement(att_idx);
		att.waitEndOfRead(); // Wait a while if already reading
	    } else if (att.get_writable() == AttrWriteType.WRITE) {
		wanted_w_attr.addElement(att_idx);
	    } else {
		// READ or READ_WITH_WRITE
		wanted_attr.addElement(att_idx);
		att.waitEndOfRead(); // Wait a while if already reading
	    }
	}
    }
823898
public AttributeValue getAttributeValueObject_2() throws DevFailed {
		// Build a DeviceAttribute_3 from this
		final DeviceAttribute_3DAODefaultImpl att = new DeviceAttribute_3DAODefaultImpl();
		att.setAttributeValue(this);
		return att.getAttributeValueObject_2();
    }
70419
static byte[] marshallIDL5Config(AttributeConfig_5 config) {
        XLOGGER.entry();
        //  System.out.println("config "+ ToStringBuilder.reflectionToString(config, ToStringStyle.MULTI_LINE_STYLE));
        final CDROutputStream os = new CDROutputStream();
        try {
            AttributeConfig_5Helper.write(os, config);
            XLOGGER.exit();
            return cppAlignment(os.getBufferCopy());
        } finally {
            os.close();
        }
    }