Examples of OpenType


Examples of javax.management.openmbean.OpenType

        {
            // no OpenType for a null
            throw new IllegalArgumentException();
        }

        OpenType type = getSimpleType(o.getClass());

        if (type == null)
        {
            final Class<?> theClass = o.getClass();
View Full Code Here

Examples of javax.management.openmbean.OpenType

        // ItemNames in composite data
        List<String> itemNames = new ArrayList<String>(data.getCompositeType().keySet());

        for (String itemName : itemNames)
        {
            OpenType itemType = data.getCompositeType().getType(itemName);
            Label keyLabel = toolkit.createLabel(compositeHolder, itemName, SWT.TRAIL);
            GridData layoutData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
            layoutData.minimumWidth = 70;
            keyLabel.setLayoutData(layoutData);

            if (itemType.isArray())
            {
                OpenType type = ((ArrayType)itemType).getElementOpenType();
                //  If Byte array and mimetype is text, convert to text string
                if (type.getClassName().equals(Byte.class.getName()))
                {
                    String mimeType = null;
                    String encoding = null;
                    if (data.containsKey("MimeType"))
                    {
                        mimeType = (String)data.get("MimeType");
                    }
                    if (data.containsKey("Encoding"))
                    {
                        encoding = (String)data.get("Encoding");
                    }
                   
                    if (encoding == null || encoding.length() == 0)
                    {
                        encoding = Charset.defaultCharset().name();
                    }

                    if ("text/plain".equals(mimeType))
                    {
                        convertByteArray(toolkit, compositeHolder, data, itemName, encoding);
                    }
                    else
                    {
                        handleBinaryMessageContent(toolkit, compositeHolder, data, itemName, encoding);
                    }                       
                }
                // If array of any other supported type, show as a list of String array
                else if (SUPPORTED_ARRAY_DATATYPES.contains(type.getClassName()))
                {
                    convertArrayItemForDisplay(compositeHolder, data, itemName);
                }
                else
                {
View Full Code Here

Examples of javax.management.openmbean.OpenType

        // ItemNames in composite data
        List<String> itemNames = new ArrayList<String>(data.getCompositeType().keySet());

        for (String itemName : itemNames)
        {
            OpenType itemType = data.getCompositeType().getType(itemName);
            Label keyLabel = toolkit.createLabel(compositeHolder, itemName, SWT.TRAIL);
            GridData layoutData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
            layoutData.minimumWidth = 70;
            keyLabel.setLayoutData(layoutData);

            if (itemType.isArray())
            {
                OpenType type = ((ArrayType)itemType).getElementOpenType();
                //  If Byte array and mimetype is text, convert to text string
                if (type.getClassName().equals(Byte.class.getName()))
                {
                    String mimeType = null;
                    String encoding = null;
                    if (data.containsKey("MimeType"))
                    {
                        mimeType = (String)data.get("MimeType");
                    }
                    if (data.containsKey("Encoding"))
                    {
                        encoding = (String)data.get("Encoding");
                    }
                   
                    if (encoding == null || encoding.length() == 0)
                    {
                        encoding = Charset.defaultCharset().name();
                    }

                    if ("text/plain".equals(mimeType))
                    {
                        convertByteArray(toolkit, compositeHolder, data, itemName, encoding);
                    }
                    else
                    {
                        setNotSupportedDataType(toolkit, compositeHolder);
                    }                       
                }
                // If array of any other supported type, show as a list of String array
                else if (SUPPORTED_ARRAY_DATATYPES.contains(type.getClassName()))
                {
                    convertArrayItemForDisplay(compositeHolder, data, itemName);
                }
                else
                {
View Full Code Here

Examples of javax.management.openmbean.OpenType

            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
                    setProperty(propertyPrefix + "." + key, value);
                } else {
                    createProperty(propertyPrefix + "." + key, value);
                }
            }
        } else if (result instanceof TabularDataSupport) {
            TabularDataSupport data = (TabularDataSupport) result;
            for (Iterator iter = data.keySet().iterator(); iter.hasNext();) {
                Object key = iter.next();
                for (Iterator iter1 = ((List) key).iterator(); iter1.hasNext();) {
                    Object key1 = iter1.next();
                    CompositeData valuedata = data.get(new Object[] { key1 });
                    Object value = valuedata.get("value");
                    OpenType type = valuedata.getCompositeType().getType(
                            "value");
                    if (type instanceof SimpleType) {
                        setProperty(propertyPrefix + "." + key1, value);
                    } else {
                        createProperty(propertyPrefix + "." + key1, value);
View Full Code Here

Examples of javax.management.openmbean.OpenType

      return ti;
   }

   static OpenType getOpenType(MetaType type) throws OpenDataException
   {
      OpenType openType = null;
      if(type instanceof SimpleMetaType)
         openType = getOpenType(SimpleMetaType.class.cast(type));
      else if(type instanceof CompositeMetaType)
         openType = getOpenType(CompositeMetaType.class.cast(type));
      else if(type instanceof ArrayMetaType)
View Full Code Here

Examples of javax.management.openmbean.OpenType

      return openType;
   }

   static OpenType getOpenType(SimpleMetaType type)
   {
      OpenType openType = null;
      if(type.equalsIgnorePrimitive(SimpleMetaType.BOOLEAN))
         openType = SimpleType.BOOLEAN;
      else if(type.equalsIgnorePrimitive(SimpleMetaType.BYTE))
         openType = SimpleType.BYTE;
      else if(type.equalsIgnorePrimitive(SimpleMetaType.CHARACTER))
View Full Code Here

Examples of javax.management.openmbean.OpenType

      return openType;
   }
   static ArrayType getOpenType(ArrayMetaType type) throws OpenDataException
   {
      int dimension = type.getDimension();
      OpenType elementType = getOpenType(type.getElementType());
      ArrayType openType = new ArrayType(dimension, elementType);
      return openType;
   }
View Full Code Here

Examples of javax.management.openmbean.OpenType

   }
   static ArrayMetaType getMetaType(ArrayType type)
      throws Exception
   {
      int dimension = type.getDimension();
      OpenType elementType = type.getElementOpenType();
      MetaType elementMetaType = getMetaType(elementType);
      ArrayMetaType metaType = new ArrayMetaType(dimension, elementMetaType);
      return metaType;
   }
View Full Code Here

Examples of javax.management.openmbean.OpenType

      type.keySet().toArray(itemNames);
      for(int n = 0; n < itemNames.length; n ++)
      {
         String itemName = itemNames[n];
         itemDescriptions[n] = type.getDescription(itemName);
         OpenType ot = type.getType(itemName);
         itemTypes[n] = getMetaType(ot);
      }
     
      String typeName = type.getTypeName();
      String description = type.getDescription();
View Full Code Here

Examples of javax.management.openmbean.OpenType

      for(int n = 0; n < cdValues.length; n ++)
      {
         String itemName = itemNames[n];
         Object ov = cdValues[n];
         itemDescriptions[n] = ct.getDescription(itemName);
         OpenType ot = ct.getType(itemName);
         try
         {
            itemTypes[n] = ManagementFactoryUtils.getMetaType(ot);
         }
         catch(Exception e)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.