@Test public void testResolveEntity() { assertEquals( "\u00a9", LatinEntities.resolveEntity( "&copy;" ) ); assertEquals( "\u221e", LatinEntities.resolveEntity( "&infin;" ) ); assertEquals( "\u00f8", LatinEntities.resolveEntity( "&oslash;" ) ); assertEquals( "", LatinEntities.resolveEntity( "" ) ); assertEquals( "&amp;", LatinEntities.resolveEntity( "&amp;" ) ); assertEquals( null, LatinEntities.resolveEntity( null ) ); }
public static String resolveEntity( String entity ) { if ( entity == null ) { return entity; } if ( entity.trim().length() <= 0 ) { return entity; } if ( !( entity.charAt( 0 ) == '&' ) && ( entity.charAt( entity.length() ) == ';' ) ) { return entity; } String result = (String) defaultEntityMap.get( entity.substring( 1, entity.length() - 1 ) ); if ( result == null ) { return entity; } return result; }
LatinEntities { public static String resolveEntity( String entity ) { if ( entity == null ) { return entity; } if ( entity.trim().length() <= 0 ) { return entity; } if ( !( entity.charAt( 0 ) == '&' ) && ( entity.charAt( entity.length() ) == ';' ) ) { return entity; } String result = (String) defaultEntityMap.get( entity.substring( 1, entity.length() - 1 ) ); if ( result == null ) { return entity; } return result; } }
LatinEntities { public static String resolveEntity( String entity ) { if ( entity == null ) { return entity; } if ( entity.trim().length() <= 0 ) { return entity; } if ( !( entity.charAt( 0 ) == '&' ) && ( entity.charAt( entity.length() ) == ';' ) ) { return entity; } String result = (String) defaultEntityMap.get( entity.substring( 1, entity.length() - 1 ) ); if ( result == null ) { return entity; } return result; }  }
LatinEntities { public static String resolveEntity( String entity ) { if ( entity == null ) { return entity; } if ( entity.trim().length() <= 0 ) { return entity; } if ( !( entity.charAt( 0 ) == '&' ) && ( entity.charAt( entity.length() ) == ';' ) ) { return entity; } String result = (String) defaultEntityMap.get( entity.substring( 1, entity.length() - 1 ) ); if ( result == null ) { return entity; } return result; }  static String resolveEntity( String entity ); }
LatinEntities { public static String resolveEntity( String entity ) { if ( entity == null ) { return entity; } if ( entity.trim().length() <= 0 ) { return entity; } if ( !( entity.charAt( 0 ) == '&' ) && ( entity.charAt( entity.length() ) == ';' ) ) { return entity; } String result = (String) defaultEntityMap.get( entity.substring( 1, entity.length() - 1 ) ); if ( result == null ) { return entity; } return result; }  static String resolveEntity( String entity );  }