cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Identify attribute type

anabors-keating
4-Participant

Identify attribute type

I have list of attributes which might be String, Double, Boolean or List values. I would like to identify what type of attribute is it based on the name of the attribute. Could anyone help me how to get to know the type of attribute?

1 REPLY 1

Hi Austin Nabors-Keating‌,

Use AttributeTypeSummary API to get this Data types for attribute defined on any object type.

PersistableAdapter obj = new PersistableAdapter(cr, null , Locale.US,null);

      /* load attribute */

      obj.load("GROUP_EFFECTIVITY");

      Object enumValue = obj.get("GROUP_EFFECTIVITY");

      System.out.println("IBA Value :: " + enumValue);

AttributeTypeSummary ats = obj.getAttributeDescriptor("GROUP_EFFECTIVITY");

      System.out.println("Display Name :: " + ats.getLabel());

System.out.println("Data Type :: " + ats.getDataType());

      System.out.println("Description :: " + ats.getDescription());

Output will looks like below:

output.png

Regards,

Shirish

Announcements

Top Tags