List of usage examples for org.apache.commons.lang StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang StringUtils EMPTY.
Click Source Link
""
. From source file:com.amalto.core.save.DOMDocumentTest.java
public void testIncludeXSINamespace() throws Exception { String lineSeparator = System.getProperty("line.separator"); StringBuilder xmlBuilder = new StringBuilder( "<Organisation xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"); xmlBuilder.append(lineSeparator);//from ww w.ja va 2 s . c om xmlBuilder.append("<IdOrganisation xsi:type=\"xsd:string\">5797</IdOrganisation>"); xmlBuilder.append(lineSeparator); xmlBuilder.append("</Organisation>"); xmlBuilder.append(lineSeparator); String xml = xmlBuilder.toString(); InputStream documentStream = new ByteArrayInputStream(xml.getBytes("UTF-8")); // Parsing MutableDocument userDocument; DocumentBuilderFactory DOM_PARSER_FACTORY = DocumentBuilderFactory.newInstance(); DOM_PARSER_FACTORY.setNamespaceAware(true); DOM_PARSER_FACTORY.setIgnoringComments(true); DOM_PARSER_FACTORY.setValidating(false); try { // Don't ignore talend internal attributes when parsing this document DocumentBuilder documentBuilder = new SkipAttributeDocumentBuilder( DOM_PARSER_FACTORY.newDocumentBuilder(), false); InputSource source = new InputSource(documentStream); Document userDomDocument = documentBuilder.parse(source); userDocument = new DOMDocument(userDomDocument, null, StringUtils.EMPTY, StringUtils.EMPTY); } catch (Exception e) { throw new RuntimeException("Unable to parse document to save.", e); } assertNotNull(userDocument); String result = userDocument.exportToString(); assertEquals(xml, result); }
From source file:info.magnolia.cms.gui.control.Button.java
public void setHtmlPost() { if (super.getHtmlPost(null) == null) { if (this.getButtonType() == BUTTONTYPE_PUSHBUTTON) { this.setHtmlPost(StringUtils.EMPTY); } else {/*from w w w .jav a 2s . c o m*/ this.setHtmlPost("</td></tr></table>"); //$NON-NLS-1$ } } }
From source file:info.magnolia.templating.jsp.taglib.EditButton.java
@Override public int doStartTag() { this.displayHandler = StringUtils.EMPTY; return EVAL_BODY_INCLUDE; }
From source file:fr.paris.lutece.plugins.workflow.modules.ticketing.service.task.TaskAssignUnitLinkedToCategory.java
@Override public String processTicketingTask(int nIdResourceHistory, HttpServletRequest request, Locale locale) { String strTaskInformation = StringUtils.EMPTY; // We get the ticket to modify Ticket ticket = getTicket(nIdResourceHistory); if (ticket != null) { AssigneeUnit assigneeUnit = ticket.getAssigneeUnit(); if (assigneeUnit == null) { assigneeUnit = new AssigneeUnit(); }/*from w w w .jav a 2 s .c o m*/ TicketCategory ticketCategory = TicketCategoryHome.findByPrimaryKey(ticket.getIdTicketCategory()); Unit unit = UnitHome.findByPrimaryKey(ticketCategory.getAssigneeUnit().getUnitId()); if (unit != null) { assigneeUnit.setUnitId(unit.getIdUnit()); assigneeUnit.setName(unit.getLabel()); ticket.setAssigneeUnit(assigneeUnit); ticket.setAssigneeUser(null); TicketHome.update(ticket); strTaskInformation = MessageFormat.format( I18nService.getLocalizedString(MESSAGE_ASSIGN_TICKET_TO_UNIT_LINKED_TO_CATEGORY_INFORMATION, Locale.FRENCH), assigneeUnit.getName(), ticketCategory.getLabel()); } } return strTaskInformation; }
From source file:com.tacitknowledge.noexcuses.MethodTester.java
/** * Hereby we mean to test all of the methods and, additionally, * handle exceptions with provided <code>exceptionHandler<code>. * // w ww. j a v a 2 s. c om * @param exceptionHandler {@link ExceptionHandler} to handle exceptions * during testing */ public MethodTester(ExceptionHandler exceptionHandler) { this(StringUtils.EMPTY, new String[] {}, new StubBuilder(), exceptionHandler); }
From source file:fr.paris.lutece.plugins.workflow.modules.ticketing.service.task.TaskAssignTicketToUnit.java
@Override public String processTicketingTask(int nIdResourceHistory, HttpServletRequest request, Locale locale) { String strTaskInformation = StringUtils.EMPTY; String strUnitId = request.getParameter(PARAMETER_ASSIGNEE_UNIT); // We get the ticket to modify Ticket ticket = getTicket(nIdResourceHistory); if (ticket != null) { AssigneeUnit assigneeUnit = ticket.getAssigneeUnit(); String strCurrentUnit = null; if (assigneeUnit == null) { assigneeUnit = new AssigneeUnit(); strCurrentUnit = I18nService.getLocalizedString(MESSAGE_ASSIGN_TICKET_TO_UNIT_NO_CURRENT_UNIT, Locale.FRENCH); } else {//w w w . ja va 2 s. c o m strCurrentUnit = assigneeUnit.getName(); } Unit unit = null; if (strUnitId != null) { unit = UnitHome.findByPrimaryKey(Integer.parseInt(strUnitId)); } if (unit != null) { if (unit.getIdUnit() != assigneeUnit.getUnitId()) { assigneeUnit.setUnitId(unit.getIdUnit()); assigneeUnit.setName(unit.getLabel()); ticket.setAssigneeUnit(assigneeUnit); ticket.setAssigneeUser(null); TicketHome.update(ticket); strTaskInformation = MessageFormat.format(I18nService .getLocalizedString(MESSAGE_ASSIGN_TICKET_TO_UNIT_INFORMATION, Locale.FRENCH), strCurrentUnit, assigneeUnit.getName()); } } } return strTaskInformation; }
From source file:com.fengduo.bee.commons.result.JsonResultUtils.java
public static String getForbiddenJson() { String forbiddenJson = StringUtils.EMPTY; Map<String, Object> params = new HashMap<String, Object>(); params.put("result", ResultCode.FORBIDDEN.getValue()); params.put("message", getMessage(ResultCode.FORBIDDEN, null)); params.put("data", ""); try {//from w w w. jav a2 s.c o m forbiddenJson = new Gson().toJson(params); } catch (Exception e) { } return forbiddenJson; }
From source file:com.mirth.connect.model.ncpdp.NCPDPReference.java
public String getDescription(String key, String version) { if (StringUtils.equals(version, VERSION_D0)) { return MapUtils.getString(NCPDPD0map, key, StringUtils.EMPTY); } else {/*www .j a v a2s . co m*/ return MapUtils.getString(NCPDP51map, key, StringUtils.EMPTY); } }
From source file:fr.paris.lutece.plugins.rss.service.type.rss.DefaultRssFeedTypeProvider.java
/** * {@inheritDoc}//from w ww . j ava 2 s . c o m */ public Item getRSSItem(IFeedResourceItem resourceItem) { Item item = new Item(); String strTitle = StringUtils.EMPTY; strTitle = resourceItem.getTitle(); item.setTitle(strTitle); item.setPubDate(resourceItem.getDate()); item.setLink(resourceItem.getLink()); Guid guid = new Guid(); guid.setValue(resourceItem.getGUID()); guid.setPermaLink(false); item.setGuid(guid); Content content = new Content(); content.setValue(resourceItem.getDescription()); item.setContent(content); return item; }
From source file:fr.paris.lutece.plugins.extend.modules.statistics.service.ResourceExtenderStatService.java
/** * {@inheritDoc}/*from w w w.jav a 2 s . co m*/ */ @Override public long getTotalNumbers(ResourceExtenderHistoryFilter filter) { ResourceExtenderHistoryFilter filterTmp = filter; // No GROUP BY filterTmp.setGroupByAttributeName(StringUtils.EMPTY); // No LIMIT OFFSET filterTmp.setItemsPerPage(ResourceExtenderHistoryFilter.ALL); filterTmp.setPageIndex(ResourceExtenderHistoryFilter.ALL); // No ORDER BY filterTmp.setSortedAttributeName(StringUtils.EMPTY); return _statDAO.loadTotalNumbers(filterTmp, ExtendPlugin.getPlugin()); }