Example usage for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY

List of usage examples for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY.

Prototype

String[] EMPTY_STRING_ARRAY

To view the source code for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY.

Click Source Link

Document

An empty immutable String array.

Usage

From source file:org.qedeq.kernel.bo.service.control.DefaultKernelQedeqBo.java

public String[] getSupportedLanguages() {
    // TODO m31 20070704: there should be a better way to
    // get all supported languages. Time for a new visitor?
    if (!isLoaded() || getQedeq() == null || getQedeq().getHeader() == null
            || getQedeq().getHeader().getTitle() == null) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }/*from   w w w  .  j a v a 2s  . com*/
    final LatexList list = getQedeq().getHeader().getTitle();
    final List result = new ArrayList(list.size());
    for (int i = 0; i < list.size(); i++) {
        if (null != list.get(i) && list.get(i).getLanguage() != null
                && list.get(i).getLanguage().trim().length() > 0) {
            result.add(list.get(i).getLanguage());
        }
    }
    return (String[]) result.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.qedeq.kernel.bo.service.control.Element2Utf8Impl.java

public String[] getUtf8(final Element element, final int maxCols) {
    final String result = Latex2UnicodeParser.transform(null, converter.getLatex(element), 0);
    if (maxCols <= 0 || result.length() < maxCols) {
        return new String[] { result };
    }/*from w  w  w.  java  2 s . co m*/
    final List list = new ArrayList();
    int index = 0;
    while (index < result.length()) {
        list.add(StringUtility.substring(result, index, maxCols));
        index += maxCols;
    }
    return (String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.qedeq.kernel.bo.service.unicode.Qedeq2UnicodeVisitor.java

private void setReason(final String reasonString) {
    final List list = new ArrayList();
    int index = 0;
    while (index < reasonString.length()) {
        list.add(StringUtility.substring(reasonString, index, reasonWidth));
        index += reasonWidth;/*from  w  w  w. ja va 2 s  .  c o  m*/
    }
    lineData.setReason((String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY));
}

From source file:org.qedeq.kernel.se.dto.module.AddVo.java

public String[] getReferences() {
    if (reference == null) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }/*w w  w  .  j av  a 2 s .c  om*/
    return new String[] { reference };
}

From source file:org.qedeq.kernel.se.dto.module.ConditionalProofVo.java

public String[] getReferences() {
    return ArrayUtils.EMPTY_STRING_ARRAY;
}

From source file:org.qedeq.kernel.se.dto.module.ModusPonensVo.java

public String[] getReferences() {
    if (reference1 == null) {
        if (reference2 == null) {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }/*from   w  ww  . j  a  v  a2 s . co m*/
        return new String[] { reference2 };
    }
    if (reference2 == null) {
        return new String[] { reference1 };
    }
    return new String[] { reference1, reference2 };
}

From source file:org.qedeq.kernel.xml.parser.CharsetParserTest.java

/**
 * Get description of source file exception list.
 *
 * @param   address  Get description for this module exceptions.
 * @return  Error description and location.
 * @throws  IOException Reading failed./*from  www.  j  ava 2 s  .c  o m*/
 */
public String[] getSourceFileExceptionList(final ModuleAddress address) throws IOException {
    final List list = new ArrayList();
    final SourceFileExceptionList sfl = getServices().getQedeqBo(address).getErrors();
    if (sfl != null) {
        final StringBuffer buffer = new StringBuffer(getServices().getSource(address));
        final TextInput input = new TextInput(buffer);
        input.setPosition(0);
        final StringBuffer buf = new StringBuffer();
        for (int i = 0; i < sfl.size(); i++) {
            buf.setLength(0);
            final SourceFileException sf = sfl.get(i);
            buf.append(sf.getDescription());
            if (sf.getSourceArea() != null && sf.getSourceArea().getStartPosition() != null) {
                buf.append("\n");
                input.setRow(sf.getSourceArea().getStartPosition().getRow());
                buf.append(StringUtility.replace(input.getLine(), "\t", " "));
                buf.append("\n");
                final StringBuffer whitespace = StringUtility
                        .getSpaces(sf.getSourceArea().getStartPosition().getColumn() - 1);
                buffer.append(whitespace);
                buffer.append("^");
            }
            list.add(buf.toString());
        }
    }
    return (String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.rapidcontext.core.data.Dict.java

/**
 * Returns an array with all the defined dictionary key names.
 * The keys are ordered as originally added to this object.
 *
 * @return an array with all dictionary key names
 *///from   w w  w  . j a v  a 2 s.  c om
public String[] keys() {
    if (size() <= 0) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    } else {
        return (String[]) map.keySet().toArray(new String[map.size()]);
    }
}

From source file:org.rapidcontext.core.storage.Path.java

/**
 * Creates a new path from a parent and a child string
 * representation (similar to a file system path).
 *
 * @param parent         the parent index path
 * @param path           the string path to parse
 *///from  w w  w.ja va  2  s  .  co  m
public Path(Path parent, String path) {
    this.parts = (parent == null) ? ArrayUtils.EMPTY_STRING_ARRAY : parent.parts;
    path = StringUtils.stripStart(path, "/");
    this.index = path.equals("") || path.endsWith("/");
    path = StringUtils.stripEnd(path, "/");
    if (!path.equals("")) {
        String[] child = path.split("/");
        String[] res = new String[this.parts.length + child.length];
        for (int i = 0; i < this.parts.length; i++) {
            res[i] = this.parts[i];
        }
        for (int i = 0; i < child.length; i++) {
            res[this.parts.length + i] = child[i];
        }
        this.parts = res;
    }
}

From source file:org.sipfoundry.sipxconfig.admin.dialplan.AttendantRule.java

public static String[] getAttendantAliasesAsArray(String aliasesString) {
    if (aliasesString == null) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }//from   www .  j a  v  a2  s  .  c  om
    return StringUtils.split(aliasesString);
}