Shows FATAL output for the Object. It uses the toString() method.

@param object Object to apply toString() too and output
429697
@Override
    public void fatal(Object object) {
        if (toSTDOUT) {
            printToStderr("FATAL", object.toString());
        } else {
            log4jLogger.fatal("" + object.toString());
        }
    }
567714
public String serialize(Object object) {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Serializing object to Json");
		}
		XStream xstream = new XStream(new JettisonMappedXmlDriver());
		String json = xstream.toXML(object);
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Object serialized well");
		}
		return json;
	}
464248
private static void toStringObject(Class<?> clazz, Object object) {
		StringBuffer buffer = (StringBuffer)ThreadUtils.getAttribute(TOSTRING_TCBUFF);

		String hexHash = Integer.toHexString(System.identityHashCode(object));
		if(0 == buffer.length()) {
			buffer.append(clazz.getSimpleName()).append('@')
					.append(hexHash).append(TOSTRING_PREFIX);
		}

		@SuppressWarnings("unchecked")
		Set<String> converted = (Set<String>)ThreadUtils.getAttribute(TOSTRING_TCATTR);
		converted.add(object.getClass().getCanonicalName() + "@" + hexHash);

		// Rekurencyjne przeglądanie wszystkich klas nadrzędnych:
		Class<?> superClass = clazz.getSuperclass();
		if(superClass != null) {
			toStringObject(superClass, object);
		}

		String hyphen = "";
		if(TOSTRING_PREFIX.charAt(0) != buffer.charAt(buffer.length() - 1)) {
			hyphen = TOSTRING_HYPHEN;
		}

		for(Field field: clazz.getDeclaredFields()) {
			try {
				field.setAccessible(true);
				if(field.isAnnotationPresent(InToString.class)) {
					InToString inToString = field.getAnnotation(InToString.class);
					if(!inToString.ignore()) {
						String name = inToString.name();
						buffer.append(hyphen)
								.append((name.length() > 0)? name : field.getName())
								.append(TOSTRING_COLON);
						toStringField(field.get(object));
						hyphen = TOSTRING_HYPHEN;
					}
				} else if((field.getModifiers() & (Modifier.STATIC | Modifier.FINAL)) == 0) {
					buffer.append(hyphen).append(field.getName()).append(TOSTRING_COLON);
					toStringField(field.get(object));
					hyphen = TOSTRING_HYPHEN;
				}
			} catch(Exception e) {
				// TODO: Zaimplementować logowanie wyjątku
				e.printStackTrace();
			}
		}
	}
309999
public Result render(Object object) {
        if (object instanceof Renderable) {
            this.content = (Renderable<?>) object;
        } else {
            this.content = new RenderableObject(object);
        }
        return this;
    }
165237
public static Map<String, Object> toMap(Object object) {
        if (object == null) {
            return null;
        }
        return toMap(toJSONString(object));
    }
174589
private <T> void println(int logLevel, T object) {
    if (logLevel < logConfiguration.logLevel) {
      return;
    }
    String objectString;
    if (object != null) {
      ObjectFormatter<? super T> objectFormatter = logConfiguration.getObjectFormatter(object);
      if (objectFormatter != null) {
        objectString = objectFormatter.format(object);
      } else {
        objectString = object.toString();
      }
    } else {
      objectString = "null";
    }
    printlnInternal(logLevel, objectString);
  }
974066
protected void appendClassName(StringBuilder buffer, Object object) {
        if (useClassName && object != null) {
            register(object);
            if (useShortClassName) {
                buffer.append(getShortClassName(object.getClass()));
            } else {
                buffer.append(object.getClass().getName());
            }
        }
    }
328134
String objectsToString(String key, Object objects) {
        java.io.StringWriter stringWriter = new java.io.StringWriter();
        stringWriter.write(key);
        stringWriter.write(":");

        if (objects == null) {
            stringWriter.write("\n");

        } else if (objects instanceof Object[]) {
            for (int i = 0; i < ((Object[]) objects).length; i++) {
                Object object = ((Object[]) objects)[i];
                if (object == null)
                    stringWriter.write("null\n");
                else {
                    stringWriter.write(((Object[]) objects)[i].toString());
                    stringWriter.write("\n");
                }
            }

        } else {
            stringWriter.write(objects.toString());
            stringWriter.write("\n");
        }

        return stringWriter.toString();
    }
63887
private static String jsonEncode(Object object) throws IOException {
      
      ObjectMapper mapper = new ObjectMapper();
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      try {
         mapper.writeValue(outputStream, object);
         return new String(outputStream.toByteArray());
      } catch (JsonGenerationException e) {
         logger.severe("unable encode");
         throw new IOException(e);
      } catch (JsonMappingException e) {
         logger.severe("unable encode");
         throw new IOException(e.getMessage());
      }
      
   }
373600
public static String toPrettyJsonString(Object object) {
        try {
            return jsonMapper.writerWithDefaultPrettyPrinter()
                    .writeValueAsString(object);
        } catch (JsonProcessingException e) {
            return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                    "toPrettyJsonString", object);
        }
    }
193817
private static String createLoggingString(Object object)
    {
        if (object == null)
        {
            return "null";
        }
        Class<? extends Object> objectClass = object.getClass();
        if (!objectClass.isArray())
        {
            return String.valueOf(object);
        }
        StringBuilder sb = new StringBuilder();
        int length = Array.getLength(object);
        sb.append("[");
        for (int i = 0; i < length; i++)
        {
            if (i > 0)
            {
                sb.append(", ");
            }
            Object element = Array.get(object, i);
            sb.append(createLoggingString(element));
        }
        sb.append("]");
        return sb.toString();
    }
1075920
protected void handleUpdatedObject(final Object object) {
		runWithWriteLock(new Runnable() {
			public void run() {
				int index = getFinalEventList().indexOf(object);
				if (index >= 0) {
					getFinalEventList().set(index, object);
				}
			}
		});
	}
568177
@Override
  public String asString(Object object)
  {
    // at this point object is guaranteed to be enumeration
    Enum<?> e = (Enum<?>)object;
    if(object instanceof OrdinalEnum) {
      return Integer.toString(e.ordinal());
    }
    return e.name();
  }
533012
public <S, T> T convertTo(Class<T> output, Object object) {
		return convertTo(output, object, DefaultBinding.class);
	}
701775
public static String simpleObjectName(Object object) {
        if (object == null) {
            return "<null>";
        }
        StringBuilder builder = new StringBuilder();
        builder.append(simpleClassName(object.getClass()))
            .append('#')
            .append(objectId(object));
        return builder.toString();
    }
1119495
public void writeObject(Object object)
        throws IOException
    {
        if (object == null) {
            writeNull();
            return;
        }

        Serializer serializer;

        serializer = _serializerFactory.getSerializer(object.getClass());

        serializer.writeObject(object, this);
    }
323936
@Override
  public void write(TextWriterStream out, String label, Object object) {
    String res = (label != null) ? label + "=" : "";
    if(object != null) {
      if(label != null) {
        res += object.toString().replace(" ", "");
      }
      else {
        res += object.toString();
      }
    }
    out.inlinePrintNoQuotes(res);
  }