本文整理了Java中org.riotfamily.common.util.Generics.newArrayList()
方法的一些代码示例,展示了Generics.newArrayList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Generics.newArrayList()
方法的具体详情如下:
包路径:org.riotfamily.common.util.Generics
类名称:Generics
方法名:newArrayList
暂无
代码示例来源:origin: riotfamily/riot
public void addClickListener(ClickListener listener) {
if (listeners == null) {
listeners = Generics.newArrayList();
}
listeners.add(listener);
}
代码示例来源:origin: riotfamily/riot
public void addChildLink(ScreenLink link) {
if (childLinks == null) {
childLinks = Generics.newArrayList();
}
childLinks.add(link);
}
代码示例来源:origin: riotfamily/riot
public final void setValue(Object value) {
selectedValues = Generics.newArrayList();
if (value != null) {
Collection<?> collection = (Collection<?>) value;
selectedValues.addAll(collection);
}
}
代码示例来源:origin: riotfamily/riot
private List<Resource> getConfigLocations() {
ArrayList<Resource> mergedConfigLocations = Generics.newArrayList();
if (configLocations != null) {
mergedConfigLocations.addAll(configLocations);
}
if (priorityConfigLocations != null) {
mergedConfigLocations.addAll(priorityConfigLocations);
}
return mergedConfigLocations;
}
代码示例来源:origin: riotfamily/riot
public void entitySaved(Object entity) {
if (!ignore.contains(entity)) {
if (savedEntities == null) {
savedEntities = Generics.newArrayList();
}
savedEntities.add(entity);
ignore.add(entity);
}
}
代码示例来源:origin: riotfamily/riot
public static String exec(String command, String... args) throws IOException {
List<String> argList = null;
if (args != null) {
argList = Generics.newArrayList();
for (String arg : args) {
argList.add(arg);
}
}
return exec(command, argList);
}
代码示例来源:origin: riotfamily/riot
private List<Field> findInverseMappingFields(Class<?> clazz) {
final List<Field> result = Generics.newArrayList();
ReflectionUtils.doWithFields(clazz, new FieldCallback() {
public void doWith(Field field) {
if (isInverseMapping(field)) {
ReflectionUtils.makeAccessible(field);
result.add(field);
}
}
});
return result;
}
代码示例来源:origin: riotfamily/riot
/**
* <objectName>
* <objectClass>
*/
public String[] resolveLabelCodes(String objectName, Class<?> objectClass) {
List<String> codes = Generics.newArrayList(2);
if (objectName != null) {
codes.add(objectName);
}
if (objectClass != null) {
codes.add(objectClass.getName());
}
return StringUtils.toStringArray(codes);
}
代码示例来源:origin: riotfamily/riot
public Collection<?> getOptionValues(Element element) {
Collection<?> keys = getKeys();
ArrayList<Object> result = Generics.newArrayList();
Iterator<?> it = OptionsModelUtils.getOptionValues(model, element).iterator();
while (it.hasNext()) {
Object key = it.next();
if (!keys.contains(key)) {
result.add(key);
}
}
return result;
}
}
代码示例来源:origin: riotfamily/riot
public void entityUpdated(Object entity, Serializable id) {
if (!ignore.contains(entity)) {
if (updates == null) {
updates = Generics.newArrayList();
}
Object oldState = oldStateSession.get(entity.getClass(), id);
updates.add(new Update(oldState, entity));
ignore.add(entity);
}
}
代码示例来源:origin: riotfamily/riot
public List<ScreenLink> getPath() {
List<ScreenLink> path = Generics.newArrayList();
DefaultScreenContext ctx = this;
while (ctx != null) {
path.add(0, ctx.getLink());
ctx = ctx.createParentContext();
}
return path;
}
代码示例来源:origin: riotfamily/riot
@RemoteMethod
public List<ComponentMetaData> getComponentMetaData(String[] types) {
List<ComponentMetaData> result = Generics.newArrayList();
for (int i = 0; i < types.length; i++) {
result.add(metaDataProvider.getMetaData(types[i]));
}
return result;
}
代码示例来源:origin: riotfamily/riot
public void setPriorityConfigLocations(Resource[] configLocations) {
this.priorityConfigLocations = Generics.newArrayList();
if (configLocations != null) {
for (int i = 0; i < configLocations.length; i++) {
this.priorityConfigLocations.add(configLocations[i]);
}
}
configWatcher.setResources(getConfigLocations());
}
代码示例来源:origin: riotfamily/riot
public void setConfigLocations(Resource[] configLocations) {
this.configLocations = Generics.newArrayList();
if (configLocations != null) {
for (int i = 0; i < configLocations.length; i++) {
this.configLocations.add(configLocations[i]);
}
}
configWatcher.setResources(getConfigLocations());
}
代码示例来源:origin: riotfamily/riot
private void updateSelection(String[] indexes) {
List<OptionItem> items = getOptionItems();
selectedValues = Generics.newArrayList();
if (indexes != null) {
for (int i = 0; i < indexes.length; i++) {
int index = Integer.parseInt(indexes[i]);
if (index != -1) {
selectedValues.add(((OptionItem) items.get(index)).getValue());
}
}
}
validate();
}
代码示例来源:origin: riotfamily/riot
protected List<Page> filterPages(Collection<? extends Page> pages) {
ArrayList<Page> result = Generics.newArrayList();
for (Page page : pages) {
if (page.getContentContainer().getLiveVersion() != null || isPreview(page)) {
result.add(page);
}
}
return result;
}
代码示例来源:origin: riotfamily/riot
private Collection<Page> getChildren(Page page) {
List<Page> result = Generics.newArrayList();
VirtualPageType type = page.getSite().getSchema().getVirtualChildType(page);
if (type != null) {
result.addAll(type.listChildren(page));
}
result.addAll(page.getChildren());
return result;
}
代码示例来源:origin: riotfamily/riot
private List<ListItem> createChildItems(Object parent, ListItem expanded) {
List<ListItem> items = Generics.newArrayList();
for (Object child : dao.list(parent, getParams())) {
if (AccessController.isGranted("viewItem", child, screenContext)) {
items.add(createItem(child, expanded));
}
}
return items;
}
代码示例来源:origin: riotfamily/riot
private List<String> getErrorMessages(List<? extends ObjectError> errors) {
ArrayList<String> messages = Generics.newArrayList();
for (ObjectError error : errors) {
String message = form.getFormContext().getMessageResolver().getMessage(error);
if (!StringUtils.hasLength(message)) {
message = StringUtils.arrayToCommaDelimitedString(error.getCodes());
}
messages.add(message);
}
return messages;
}
代码示例来源:origin: riotfamily/riot
public List<Page> getChildren() {
ArrayList<Page> result = Generics.newArrayList();
CacheTagUtils.tagIfSupported(page);
VirtualPageType type = page.getSite().getSchema().getVirtualChildType(page);
if (type != null) {
Collection<Page> children = type.listChildren(page);
CacheTagUtils.tagIfSupported(children);
result.addAll(filterPages(children)) ;
}
result.addAll(filterPages(page.getChildren()));
return result;
}
内容来源于网络,如有侵权,请联系作者删除!