code: public static void setFieldProtected(FormModel formModel, String fieldName, boolean protectedField) {
          FieldMetadata metaData = formModel.getFieldMetadata(fieldName);
          metaData.getAllUserMetadata().put(PROTECTED_FIELD, Boolean.valueOf(protectedField));
      }
docs: defines the protectable state for a field
  
  @param formModel the formmodel
  @param fieldName the field to protect
  @param protectedField if true the field will be defined as protectable otherwise false