@Override public void registerIndexerPostProcessor( IndexerPostProcessor indexerPostProcessor) { List<IndexerPostProcessor> indexerPostProcessorsList = ListUtil.fromArray(_indexerPostProcessors); indexerPostProcessorsList.add(indexerPostProcessor); _indexerPostProcessors = indexerPostProcessorsList.toArray( new IndexerPostProcessor[indexerPostProcessorsList.size()]); }
@Override public void unregisterIndexerPostProcessor( IndexerPostProcessor indexerPostProcessor) { List<IndexerPostProcessor> indexerPostProcessorsList = ListUtil.fromArray(_indexerPostProcessors); indexerPostProcessorsList.remove(indexerPostProcessor); _indexerPostProcessors = indexerPostProcessorsList.toArray( new IndexerPostProcessor[indexerPostProcessorsList.size()]); }
public static List<String> fromString(String s, String delimiter) { return fromArray(StringUtil.split(s, delimiter)); }
public static List<String> fromString(String s) { return fromArray(StringUtil.splitLines(s)); }
public void setValue(Locale locale, Serializable value) { List<Serializable> values = null; if (value != null) { Class<?> clazz = value.getClass(); if (clazz.isArray()) { values = ListUtil.fromArray((Serializable[])value); } } if (values == null) { values = new ArrayList<>(); values.add(value); } _valuesMap.put(locale, values); }
public static List fromString(String s) { return fromArray(StringUtil.split(s, StringPool.NEW_LINE)); }
protected List<com.liferay.dynamic.data.mapping.model.DDMFormRule> getDDMFormRules() { List<com.liferay.dynamic.data.mapping.model.DDMFormRule> ddmFormRules = new ArrayList<>(); for (DDMFormRule ddmFormRule : _ddmForm.rules()) { ddmFormRules.add( new com.liferay.dynamic.data.mapping.model.DDMFormRule( ddmFormRule.condition(), ListUtil.fromArray(ddmFormRule.actions()))); } return ddmFormRules; }
protected List<String> getFieldNames( String fieldNamespace, String fieldName, ServiceContext serviceContext) { String[] fieldsDisplayValues = StringUtil.split( (String)serviceContext.getAttribute( fieldNamespace + FIELDS_DISPLAY_NAME)); List<String> privateFieldNames = ListUtil.fromArray( new String[] {FIELDS_DISPLAY_NAME}); List<String> fieldNames = new ArrayList<>(); if ((fieldsDisplayValues.length == 0) || privateFieldNames.contains(fieldName)) { fieldNames.add(fieldNamespace + fieldName); } else { for (String namespacedFieldName : fieldsDisplayValues) { String fieldNameValue = StringUtil.extractFirst( namespacedFieldName, INSTANCE_SEPARATOR); if (fieldNameValue.equals(fieldName)) { fieldNames.add(fieldNamespace + namespacedFieldName); } } } return fieldNames; }
public static void removeAndStoreSelection( List<String> assetEntryUuids, PortletPreferences portletPreferences) throws Exception { if (assetEntryUuids.isEmpty()) { return; } String[] assetEntryXmls = portletPreferences.getValues( "assetEntryXml", new String[0]); List<String> assetEntryXmlsList = ListUtil.fromArray(assetEntryXmls); Iterator<String> itr = assetEntryXmlsList.iterator(); while (itr.hasNext()) { String assetEntryXml = itr.next(); Document document = SAXReaderUtil.read(assetEntryXml); Element rootElement = document.getRootElement(); String assetEntryUuid = rootElement.elementText("asset-entry-uuid"); if (assetEntryUuids.contains(assetEntryUuid)) { itr.remove(); } } portletPreferences.setValues( "assetEntryXml", assetEntryXmlsList.toArray(new String[assetEntryXmlsList.size()])); portletPreferences.store(); }
private void _removeAndStoreSelection( List<String> assetEntryUuids, PortletPreferences portletPreferences) throws Exception { if (assetEntryUuids.isEmpty()) { return; } String[] assetEntryXmls = portletPreferences.getValues( "assetEntryXml", new String[0]); List<String> assetEntryXmlsList = ListUtil.fromArray(assetEntryXmls); Iterator<String> itr = assetEntryXmlsList.iterator(); while (itr.hasNext()) { String assetEntryXml = itr.next(); Document document = SAXReaderUtil.read(assetEntryXml); Element rootElement = document.getRootElement(); String assetEntryUuid = rootElement.elementText("asset-entry-uuid"); if (assetEntryUuids.contains(assetEntryUuid)) { itr.remove(); } } portletPreferences.setValues( "assetEntryXml", assetEntryXmlsList.toArray(new String[assetEntryXmlsList.size()])); portletPreferences.store(); }
protected com.liferay.dynamic.data.mapping.model.DDMFormLayoutColumn createDDMFormLayoutColumn( DDMFormLayoutColumn ddmFormLayoutColumnAnnotation) { com.liferay.dynamic.data.mapping.model.DDMFormLayoutColumn ddmFormLayoutColumn = new com.liferay.dynamic.data.mapping.model. DDMFormLayoutColumn(); ddmFormLayoutColumn.setDDMFormFieldNames( ListUtil.fromArray(ddmFormLayoutColumnAnnotation.value())); ddmFormLayoutColumn.setSize(ddmFormLayoutColumnAnnotation.size()); return ddmFormLayoutColumn; }
return ListUtil.fromArray(nodes.toArray(new Element[nodes.size()]));