public MultiVisitor(Visitor<E>... realVisitors) { this.realVisitors = CollectionUtil.toList(realVisitors); }
@Override public boolean supports(Element element, E[] parentPath) { if (!this.elementName.equals(element.getNodeName())) return false; return CollectionUtil.isEmpty(this.supportedParentTypes) || parentPath == null || this.supportedParentTypes.contains(ArrayUtil.lastElementOf(parentPath).getClass()); }
/** * writes the current file field content to the property. */ void update() { if (!locked) { locked = true; File[] modelFiles = (File[]) BeanUtil.getPropertyValue(bean, propertyName); List<File> viewFiles = getFiles(); if (!CollectionUtil.ofEqualContent(viewFiles, modelFiles)) { File[] files = CollectionUtil.toArray(viewFiles, File.class); BeanUtil.setPropertyValue(bean, propertyName, files); } locked = false; } }
public AbstractXMLElementParser(String elementName, Set<String> requiredAttributes, Set<String> optionalAttributes, Class<?>... supportedParentTypes) { this.elementName = elementName; this.requiredAttributes = (requiredAttributes != null ? requiredAttributes : Collections.<String>emptySet()); this.optionalAttributes = (optionalAttributes != null ? optionalAttributes : Collections.<String>emptySet()); this.supportedParentTypes = CollectionUtil.toSet(supportedParentTypes); }
@Override public boolean contains(String key) { return CollectionUtil.containsCaseInsensitive(transformKey(key), map); }
@Override public synchronized Object get(String key) { return CollectionUtil.getCaseInsensitive(transformKey(key), map); }
" FROM SYS.USER_PROCEDURES WHERE UPPER(OBJECT_TYPE) = 'PACKAGE'" + " AND PROCEDURE_NAME IS NOT NULL AND OBJECT_NAME IN (" + CollectionUtil.formatCommaSeparatedList(NameUtil.getNames(packages.values()), '\'') + ")"; List<Object[]> procInfos = DBUtil.query(query, connection); for (int i = 0; i < procInfos.size(); i++) {
public AbstractXMLElementParser(String elementName, Set<String> requiredAttributes, Set<String> optionalAttributes, Class<?>... supportedParentTypes) { this.elementName = elementName; this.requiredAttributes = (requiredAttributes != null ? requiredAttributes : Collections.<String>emptySet()); this.optionalAttributes = (optionalAttributes != null ? optionalAttributes : Collections.<String>emptySet()); this.supportedParentTypes = CollectionUtil.toSet(supportedParentTypes); }
public ListDataIterator(Class<E> type, E... data) { this(type, CollectionUtil.toList(data)); }
public File[] getFiles() { return CollectionUtil.toArray(files, File.class); }
public static CharSet toCharSet(Object o) { if (o instanceof CharSet) return (CharSet) o; else if (o instanceof Character) return new CharSet(CollectionUtil.toSet((Character) o)); else if (o instanceof CustomCharClass) return ((CustomCharClass) o).getCharSet(); else throw new IllegalArgumentException("Not a supported character regex type: " + o.getClass()); }
public boolean supports(Element element, E[] parentPath) { if (!this.elementName.equals(element.getNodeName())) return false; return CollectionUtil.isEmpty(this.supportedParentTypes) || parentPath == null || this.supportedParentTypes.contains(ArrayUtil.lastElementOf(parentPath).getClass()); }
public ListDataIterator(Class<E> type, E... data) { this(type, CollectionUtil.toList(data)); }
private String[] getColumnNames(Expression<?> condition) { return CollectionUtil.toArray(scanForColumns(condition, new HashSet<String>()), String.class); }
public Query(String selection, String table, String whereClause) { this.selectConditions = new ArrayList<String>(); this.selections = CollectionUtil.toList(selection); this.tablesWithAliases = new ArrayList<String>(); this.joins = new ArrayList<String>(); if (table != null) this.tablesWithAliases.add(table); this.whereClause = new StringBuilder(); if (whereClause != null) this.whereClause.append(whereClause); this.options = new ArrayList<String>(); }
@SuppressWarnings("unchecked") private Choice convertChoice(CommonTree node) throws SyntaxError { List<CommonTree> childNodes = node.getChildren(); List<RegexPart> childPatterns = new ArrayList<RegexPart>(); if (childNodes != null) for (CommonTree childNode : childNodes) childPatterns.add(convertRegexPart(childNode)); return new Choice(CollectionUtil.toArray(childPatterns, RegexPart.class)); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public List<File> getSelectedFiles() { return (List) CollectionUtil.toList(list.getSelectedValues()); }
private String[] parseNextLine() throws IOException { if (tokenizer == null) return null; List<String> list; CSVTokenType tokenType; do { list = new ArrayList<String>(); while ((tokenType = tokenizer.next()) == CSVTokenType.CELL) { list.add(tokenizer.cell); } if (tokenType == CSVTokenType.EOF) close(); } while (tokenType != CSVTokenType.EOF && (ignoreEmptyLines && list.size() == 0)); if (list.size() > 0) { eol = (tokenType == CSVTokenType.EOL); return CollectionUtil.toArray(list, String.class); } if (eol && !ignoreEmptyLines) return new String[0]; else return null; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public void addLeafAtCurrentPath(String nodeName, String content) { OrderedNameMap<Object> parent = this.currentPath.peek(); Object formerContent = parent.get(nodeName); if (formerContent == null) parent.put(nodeName, content); else if (formerContent instanceof Collection) ((Collection) formerContent).add(content); else parent.put(nodeName, CollectionUtil.toList(formerContent, content)); }