code: public static String toMMCIF(String categoryName, Object o) {
  
  		StringBuilder sb = new StringBuilder();
  
  		Class<?> c = o.getClass();
  
  
  		Field[] fields = getFields(c);
  		String[] names = getFieldNames(fields);
  
  		int maxFieldNameLength = getMaxStringLength(names);
  
  		for (int i=0;i<fields.length;i++) {
  			Field f = fields[i];
  			String name = names[i];
  
  			sb.append(categoryName).append(".").append(name);
  
  			int spacing = maxFieldNameLength - name.length() + 3;
  
  			try {
  				Object obj = f.get(o);
  				String val;
  				if (obj==null) {
  					logger.debug("Field {} is null, will write it out as {}",name,MMCIF_MISSING_VALUE);
  					val = MMCIF_MISSING_VALUE;
  				} else {
  					val = (String) obj;
  				}
  				for (int j=0;j<spacing;j++) sb.append(' ');
  				sb.append(addMmCifQuoting(val));
  				sb.append(newline);
  
  			} catch (IllegalAccessException e) {
  				logger.warn("Field {} is inaccessible", name);
  				continue;
  			} catch (ClassCastException e) {
  				logger.warn("Could not cast value to String for field {}",name);
  				continue;
  			}
  
  		}
  
  		sb.append(SimpleMMcifParser.COMMENT_CHAR+newline);
  
  		return sb.toString();
  	}
docs: Converts a mmCIF bean (see {@link org.biojava.nbio.structure.io.mmcif.model} to
  a String representing it in mmCIF (single-record) format.
  @param categoryName
  @param o
  @return