List of usage examples for org.apache.commons.lang StringEscapeUtils escapeHtml
public static String escapeHtml(String input)
From source file:ch.systemsx.cisd.openbis.generic.shared.translator.DataStoreTranslator.java
public static DataStore translate(DataStorePE dataStorePE, String defaultDataStoreBaseURL) { DataStore dataStore = new DataStore(); String downloadUrl = dataStorePE.getDownloadUrl(); downloadUrl = translateDownloadUrl(defaultDataStoreBaseURL, downloadUrl); dataStore.setDownloadUrl(downloadUrl); dataStore.setCode(StringEscapeUtils.escapeHtml(dataStorePE.getCode())); return dataStore; }
From source file:fr.obeo.dsl.designer.gen.html.services.StringUtils.java
/** * Escape a message so it can be safely embedded inside HTML code * @param message/*from w w w .j a v a 2 s . co m*/ * @return Escaped message */ public static String escapeHtml(String message) { return StringEscapeUtils.escapeHtml(message); }
From source file:ch.systemsx.cisd.openbis.generic.shared.translator.DatabaseInstanceTranslator.java
public final static DatabaseInstance translate(final DatabaseInstancePE databaseInstance) { if (databaseInstance == null) { return null; }//from w w w . j a v a 2s . c o m final DatabaseInstance result = new DatabaseInstance(); result.setCode(StringEscapeUtils.escapeHtml(databaseInstance.getCode())); result.setUuid(StringEscapeUtils.escapeHtml(databaseInstance.getUuid())); result.setIdentifier(StringEscapeUtils .escapeHtml(IdentifierHelper.createDatabaseInstanceIdentifier(databaseInstance).toString())); return result; }
From source file:net.landora.animeinfo.anidb.AniDBCommand.java
private static void appendEscape(StringBuffer buffer, String str) { str = StringEscapeUtils.escapeHtml(str); str = str.replaceAll("\\n", "<br />"); buffer.append(str);/*ww w . j a v a 2s .c o m*/ }
From source file:com.runwaysdk.web.view.html.EscapeUtil.java
/** * Escapes both HTML and Javascript//from w w w .j av a 2 s .co m * * @param html * @return */ public static final String escapeHTMLAndJS(String html) { html = StringEscapeUtils.escapeHtml(html); html = StringEscapeUtils.escapeJavaScript(html); return html; }
From source file:com.softwarementors.extjs.djn.EncodingUtils.java
@Nullable public static String htmlEncode(@Nullable String value) { if (value == null) { return value; }/*ww w. j ava 2 s . com*/ return StringEscapeUtils.escapeHtml(value); }
From source file:ch.systemsx.cisd.openbis.generic.shared.translator.SampleTypeTranslator.java
public static SampleType translate(final SampleTypePE sampleTypePE, Map<PropertyTypePE, PropertyType> cacheOrNull) { final SampleType result = new SampleType(); result.setCode(StringEscapeUtils.escapeHtml(sampleTypePE.getCode())); result.setListable(sampleTypePE.isListable()); result.setDescription(StringEscapeUtils.escapeHtml(sampleTypePE.getDescription())); result.setGeneratedFromHierarchyDepth(sampleTypePE.getGeneratedFromHierarchyDepth()); result.setContainerHierarchyDepth(sampleTypePE.getContainerHierarchyDepth()); result.setSampleTypePropertyTypes(SampleTypePropertyTypeTranslator .translate(sampleTypePE.getSampleTypePropertyTypes(), result, cacheOrNull)); result.setDatabaseInstance(DatabaseInstanceTranslator.translate(sampleTypePE.getDatabaseInstance())); return result; }
From source file:ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTypeTranslator.java
public static DataSetType translate(DataSetTypePE entityTypeOrNull, Map<PropertyTypePE, PropertyType> cacheOrNull) { if (entityTypeOrNull == null) { return null; }/*from w ww. j av a2 s . co m*/ final DataSetType result = new DataSetType(); result.setCode(StringEscapeUtils.escapeHtml(entityTypeOrNull.getCode())); result.setDescription(StringEscapeUtils.escapeHtml(entityTypeOrNull.getDescription())); result.setDatabaseInstance(DatabaseInstanceTranslator.translate(entityTypeOrNull.getDatabaseInstance())); result.setDataSetTypePropertyTypes(DataSetTypePropertyTypeTranslator .translate(entityTypeOrNull.getDataSetTypePropertyTypes(), result, cacheOrNull)); return result; }
From source file:ch.systemsx.cisd.openbis.generic.shared.translator.VocabularyTermTranslator.java
public static VocabularyTerm translate(VocabularyTermPE vt) { if (vt == null) { return null; }// w ww . ja v a 2 s.c om VocabularyTerm result = new VocabularyTerm(); result.setId(HibernateUtils.getId(vt)); result.setCode(StringEscapeUtils.escapeHtml(vt.getCode())); result.setLabel(StringEscapeUtils.escapeHtml(vt.getLabel())); result.setDescription(StringEscapeUtils.escapeHtml(vt.getDescription())); result.setUrl(StringEscapeUtils.escapeHtml(vt.getUrl())); result.setRegistrationDate(vt.getRegistrationDate()); result.setRegistrator(PersonTranslator.translate(vt.getRegistrator())); return result; }
From source file:com.bstek.dorado.web.resolver.StringEscapeHelper.java
public String html(String s) { return StringEscapeUtils.escapeHtml(s); }