@Test public void testGetSerializer_others() throws SerializationException { boolean isException = false; try { SerializerFactory.getSerializer("others"); } catch (SerializationException e) { isException = true; } Assert.assertTrue(isException); }
public static IEntitySerializer getSerializer(final String serializeFormat) throws SerializationException { IEntitySerializer serializer = null; if (isValidSerializeFormat(serializeFormat)) { if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT)) { serializer = new XMLSerializer(); } else if (serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { serializer = new JSONSerializer(); } } return serializer; }
SerializerFactory { public static IEntitySerializer getSerializer(final String serializeFormat) throws SerializationException { IEntitySerializer serializer = null; if (isValidSerializeFormat(serializeFormat)) { if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT)) { serializer = new XMLSerializer(); } else if (serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { serializer = new JSONSerializer(); } } return serializer; } }
SerializerFactory { public static IEntitySerializer getSerializer(final String serializeFormat) throws SerializationException { IEntitySerializer serializer = null; if (isValidSerializeFormat(serializeFormat)) { if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT)) { serializer = new XMLSerializer(); } else if (serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { serializer = new JSONSerializer(); } } return serializer; } private  SerializerFactory(); }
SerializerFactory { public static IEntitySerializer getSerializer(final String serializeFormat) throws SerializationException { IEntitySerializer serializer = null; if (isValidSerializeFormat(serializeFormat)) { if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT)) { serializer = new XMLSerializer(); } else if (serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { serializer = new JSONSerializer(); } } return serializer; } private  SerializerFactory(); static SerializerFactory getInstance(); static IEntitySerializer getSerializer(final String serializeFormat); static boolean isValidSerializeFormat(final String serializeFormat); }
SerializerFactory { public static IEntitySerializer getSerializer(final String serializeFormat) throws SerializationException { IEntitySerializer serializer = null; if (isValidSerializeFormat(serializeFormat)) { if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT)) { serializer = new XMLSerializer(); } else if (serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) { serializer = new JSONSerializer(); } } return serializer; } private  SerializerFactory(); static SerializerFactory getInstance(); static IEntitySerializer getSerializer(final String serializeFormat); static boolean isValidSerializeFormat(final String serializeFormat); static final String XML_SERIALIZE_FORMAT; static final String JSON_SERIALIZE_FORMAT; }