Search in sources :

Example 1 with SServiceType

use of org.bimserver.interfaces.objects.SServiceType in project BIMserver by opensourceBIM.

the class MetaServiceImpl method createSServiceType.

// TODO Recursion to same type will result in endless loop
public SServiceType createSServiceType(SClass sClass, boolean recurse) throws UserException, ServerException {
    if (sClass == null) {
        return null;
    }
    SServiceType sServiceType = new SServiceType();
    sServiceType.setName(sClass.getName());
    sServiceType.setSimpleName(sClass.getSimpleName());
    sServiceType.setSimpleType(SServiceSimpleType.valueOf(sClass.getSimpleType().name()));
    for (SField field : sClass.getOwnFields()) {
        SServiceField sServiceField = new SServiceField();
        sServiceField.setName(field.getName());
        if (recurse) {
            sServiceField.setType(createSServiceType(field.getType(), recurse));
            sServiceField.setGenericType(createSServiceType(field.getGenericType(), recurse));
        }
        sServiceField.setDoc(field.getDoc());
        sServiceType.getFields().add(sServiceField);
    }
    return sServiceType;
}
Also used : SField(org.bimserver.shared.meta.SField) SServiceType(org.bimserver.interfaces.objects.SServiceType) SServiceField(org.bimserver.interfaces.objects.SServiceField)

Aggregations

SServiceField (org.bimserver.interfaces.objects.SServiceField)1 SServiceType (org.bimserver.interfaces.objects.SServiceType)1 SField (org.bimserver.shared.meta.SField)1