List of usage examples for java.util Properties getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.talend.daikon.properties.PropertiesImpl.java
@Override public void assignNestedProperties(Properties... newValueProperties) { List<Field> propertyFields = getAnyPropertyFields(); for (Field propField : propertyFields) { Class<?> propType = propField.getType(); if (Properties.class.isAssignableFrom(propType)) { boolean isNewAssignment = false; for (Properties newValue : newValueProperties) { if (propType.isAssignableFrom(newValue.getClass())) { try { propField.set(this, newValue); } catch (IllegalArgumentException | IllegalAccessException e) { throw new TalendRuntimeException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e); }// ww w . j a va 2 s .c o m isNewAssignment = true; } // else not a compatible type so keep looking } if (!isNewAssignment) {// recurse Properties prop; try { prop = (Properties) propField.get(this); if (prop != null) { prop.assignNestedProperties(newValueProperties); } // else prop value is null so we can't recurse. this should never happend } catch (IllegalArgumentException | IllegalAccessException e) { throw new TalendRuntimeException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e); } // cast is ok we check it was assignable before. } } // else not a nestedProperties so keep looking. } }