Example usage for org.apache.commons.lang StringUtils EMPTY

List of usage examples for org.apache.commons.lang StringUtils EMPTY

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils EMPTY.

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:com.tera.lapi.network.packet.server.S_ACCOUNT_AUTH_STATUS.java

/**
 * <p>//from  w  w  w.j a va  2 s  .c  o m
 * This constructor should be used for sending unsuccessful authentication
 * status
 * </p>
 * 
 * @param channelId
 * @param accountId
 */
public S_ACCOUNT_AUTH_STATUS(int channelId, int accountId) {
    this.channelId = channelId;
    this.accountId = accountId;
    this.accountName = StringUtils.EMPTY;
    this.accessLevel = 0;
    this.membership = 0;
    this.success = false;
}

From source file:com.bfd.harpc.config.spring.HarpcBeanDefinitionParser.java

/**
 * {@link#parse}/*from   ww  w.  j  a v a 2s  .co  m*/
 * <p>
 * 
 * @param element
 * @param parserContext
 * @param clazz
 * @return {@link BeanDefinition}
 */
private BeanDefinition parse(Element element, ParserContext parserContext, Class<?> clazz) {
    RootBeanDefinition beanDefinition = new RootBeanDefinition();
    beanDefinition.setBeanClass(clazz);

    Method[] methods = clazz.getMethods();
    String id = StringUtils.EMPTY;
    for (Method method : methods) {
        if (method.getName().length() > 3 && method.getName().startsWith("set")
                && method.getParameterTypes().length == 1) {
            String attribute = method.getName().substring(3);
            char ch = attribute.charAt(0);
            attribute = Character.toLowerCase(ch) + attribute.substring(1);

            String value = element.getAttribute(attribute);

            if (StringUtils.isNotEmpty(value)) {
                Type type = method.getParameterTypes()[0];
                if (type == boolean.class) {
                    beanDefinition.getPropertyValues().addPropertyValue(attribute, Boolean.valueOf(value));
                } else {
                    if ("ref".equals(attribute) && parserContext.getRegistry().containsBeanDefinition(value)) {
                        beanDefinition.getPropertyValues().addPropertyValue(attribute,
                                new RuntimeBeanReference(value));
                    } else {
                        beanDefinition.getPropertyValues().addPropertyValue(attribute, value);
                        if ("id".equals(attribute)) {
                            id = value;
                        }
                    }
                }
            }
        }
    }
    parserContext.getRegistry().registerBeanDefinition(id, beanDefinition);

    return beanDefinition;
}

From source file:com.seitenbau.jenkins.plugins.dynamicparameter.ChoiceParameterDefinitionTest.java

private static ChoiceParameterDefinition createChoiceParameterDefinition(
        ChoiceParameterDefinitionParameterBuilder choiceParameterBuilder) {
    ChoiceParameterDefinitionParameter parameter = choiceParameterBuilder.build();
    return new ChoiceParameterDefinition(parameter.getName(), parameter.getScript(), parameter.getDescription(),
            parameter.getUuid(), parameter.isRemote(), StringUtils.EMPTY);
}

From source file:com.amalto.core.history.EmptyDocument.java

@Override
public String getDataCluster() {
    return StringUtils.EMPTY;
}

From source file:info.magnolia.module.admininterface.PageMVCServlet.java

/**
 *
 *//*from w w  w  . j  ava2  s . c om*/
protected MVCServletHandler getHandler(HttpServletRequest request, HttpServletResponse response) {

    String pageName = RequestFormUtil.getParameter(request, "mgnlPage"); //$NON-NLS-1$
    if (StringUtils.isEmpty(pageName)) {
        pageName = (String) request.getAttribute("javax.servlet.include.request_uri"); //$NON-NLS-1$
        if (StringUtils.isEmpty(pageName)) {
            pageName = (String) request.getAttribute("javax.servlet.forward.servlet_path"); //$NON-NLS-1$
        }
        if (StringUtils.isEmpty(pageName)) {
            pageName = request.getRequestURI();
        }
        pageName = StringUtils.replaceOnce(StringUtils.substringAfterLast(pageName, "/pages/"), ".html", //$NON-NLS-1$ //$NON-NLS-2$
                StringUtils.EMPTY);
    }

    PageMVCHandler handler = null;

    if (pageName != null) {
        // try to get a registered handler
        try {
            handler = PageHandlerManager.getInstance().getPageHandler(pageName, request, response);
        } catch (InvalidDialogPageHandlerException e) {
            log.error("no page found: [" + pageName + "]"); //$NON-NLS-1$
        }
    } else {
        log.error("no dialogpage name passed"); //$NON-NLS-1$
    }

    return handler;
}

From source file:com.stevpet.sonar.plugins.dotnet.mscover.sensor.results.resultssensor.ShouldExecuteTest.java

@Test
public void RunModeIsSkipNotExecuteRootNotProjectIsRootPathEmpty_False() {
    testSkipModeAlwaysFalse(false, false, StringUtils.EMPTY);

}

From source file:com.cyclopsgroup.waterview.web.ProcessFormValve.java

/**
 * Overwrite or implement method invoke()
 *
 * @see com.cyclopsgroup.waterview.spi.Valve#invoke(com.cyclopsgroup.waterview.RuntimeData, com.cyclopsgroup.waterview.spi.PipelineContext)
 *///  w w w  .  j  a  v  a 2 s  .co m
public void invoke(RuntimeData data, PipelineContext pc) throws Exception {
    Parameters params = data.getParameters();
    String formId = params.getString("form_id");
    Form form = null;
    if (StringUtils.isNotEmpty(formId)) {
        form = (Form) data.getSessionContext().get(formId);
    }

    if (form == null) {
        pc.invokeNextValve(data);
        return;
    }

    boolean hasError = false;
    Field[] fields = form.getFields();
    for (int i = 0; i < fields.length; i++) {
        Field field = fields[i];
        field.setValue(params.getString(field.getName()));
        field.validate();
        if (field.isPassword()) {
            field.setValue(StringUtils.EMPTY);
        }
        if (!hasError && field.isInvalid()) {
            hasError = true;
        }
    }
    if (hasError) {
        if (params.getBoolean("force_validation")) {
            fail(data, pc);
            return;
        }
    }
    pc.invokeNextValve(data);
    Boolean formInvalid = (Boolean) data.getRequestContext().get("formInvalid");
    if (formInvalid != null && formInvalid.booleanValue()) {
        Properties formErrors = (Properties) data.getRequestContext().get("formErrors");
        for (Iterator i = formErrors.keySet().iterator(); i.hasNext();) {
            String fieldName = (String) i.next();
            String errorMessage = formErrors.getProperty(fieldName);
            Field field = form.getField(fieldName);
            if (field != null) {
                field.setInvalid(true);
                if (StringUtils.isEmpty(errorMessage)) {
                    field.setErrorMessage("Invalid field value ");
                } else {
                    field.setErrorMessage(errorMessage);
                }
            }
        }
        if (params.getBoolean("force_validation")) {
            fail(data, pc);
        }
    }
}

From source file:hudson.plugins.debt.parser.DebtParser.java

/**
 * Creates a new instance of {@link DebtParser}.
 */// w w  w. j  ava 2  s  .c o m
public DebtParser() {
    super(StringUtils.EMPTY);

    System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>In the simple DebtParser constructor.");
}

From source file:edu.northwestern.bioinformatics.studycalendar.web.NewSiteCommandTest.java

public void testValidateWhenSiteNameEmpty() throws Exception {
    replayMocks();// ww  w .ja  va  2  s . co m
    BindException errors = new BindException(command, StringUtils.EMPTY);
    command.validate(errors);
    verifyMocks();

    assertTrue(errors.hasErrors());
    assertEquals("Wrong error count", 1, errors.getErrorCount());
    assertEquals("Wrong error code", "error.site.name.is.empty", errors.getFieldError().getCode());
}

From source file:com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.java

@Test
public void emptyInputRendersNothing() throws IOException {
    assertEquals(PROLOG + EPILOG, formatter.format(null, null, null, null, cfg, StringUtils.EMPTY));
}