public String format(Object object, String format) {
		if (object == null) {
			return getNullMessage();
		}
		StringBuilder builder = new StringBuilder();
		char[] formatChars = format.toCharArray();
		int i = 0;
		while (i < formatChars.length) {
			char token = formatChars[i];
			if (OPEN_TAG == token) {
				int endTagIndex = format.indexOf(CLOSE_TAG, i);
				if (endTagIndex == -1) {
					// no more tags
					builder.append(format.substring(i));
					break;
				}
				int nextOpenTagIndex = format.indexOf(OPEN_TAG, i + 1);
				if (nextOpenTagIndex != -1 && nextOpenTagIndex < endTagIndex) {
					// just a single '{' not a tag
					builder.append(format.substring(i, nextOpenTagIndex));
					i = nextOpenTagIndex;
				} else {
					// parse a possible tag
					String tag = format.substring(i, endTagIndex + 1);
					if (getTags(object.getClass()).contains(tag)) {
						builder.append(getAttribute(object, tag.substring(1, tag.length() - 1)));
					} else {
						// not a tag
						builder.append(tag);
					}
					i = endTagIndex + 1;
				}
			} else {
				int nextOpenTagIndex = format.indexOf(OPEN_TAG, i + 1);
				if (nextOpenTagIndex == -1) {
					builder.append(format.substring(i));
					break;
				} else {
					builder.append(format.substring(i, nextOpenTagIndex));
					i = nextOpenTagIndex;
				}
			}
		}
		
		return builder.toString();
	}