• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ObjectSpecification类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.isis.core.metamodel.spec.ObjectSpecification的典型用法代码示例。如果您正苦于以下问题:Java ObjectSpecification类的具体用法?Java ObjectSpecification怎么用?Java ObjectSpecification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectSpecification类属于org.apache.isis.core.metamodel.spec包,在下文中一共展示了ObjectSpecification类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateColumnMemberGroups

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private static void updateColumnMemberGroups(final ObjectSpecification objectSpec, final MemberGroupLayoutHint hint, final ColumnRepr columnRepr) {
    final List<ObjectAssociation> objectAssociations = propertiesOf(objectSpec);
    final Map<String, List<ObjectAssociation>> associationsByGroup = ObjectAssociation.Util.groupByMemberOrderName(objectAssociations);
    
    final List<String> groupNames = ObjectSpecifications.orderByMemberGroups(objectSpec, associationsByGroup.keySet(), hint);
    
    columnRepr.memberGroups = Maps.newLinkedHashMap();
    for (final String groupName : groupNames) {
        final MemberGroupRepr memberGroupRepr = new MemberGroupRepr();
        columnRepr.memberGroups.put(groupName, memberGroupRepr);
        final List<ObjectAssociation> associationsInGroup = associationsByGroup.get(groupName);
        memberGroupRepr.members = Maps.newLinkedHashMap();
        if(associationsInGroup == null) {
            continue;
        }
        for (final ObjectAssociation assoc : associationsInGroup) {
            final MemberRepr memberRepr = newMemberRepr(assoc);
            memberGroupRepr.members.put(assoc.getId(), memberRepr);
        }
    }
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:22,代码来源:LayoutJsonExporter.java


示例2: getCellValue

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
Object getCellValue(final Cell cell, final OneToOneAssociation otoa) {

        final int cellType = cell.getCellType();

        if(cellType == HSSFCell.CELL_TYPE_BLANK) {
            return null;
        }

        final ObjectSpecification propertySpec = otoa.getSpecification();
        Class<?> requiredType = propertySpec.getCorrespondingClass();
        
        // value types
        if(propertySpec.isValue()) {
            return getCellValue(cell, requiredType);
        }
        
        // reference types
        if(!propertySpec.isParentedOrFreeCollection()) {
            return getCellComment(cell, requiredType);
        }
        
        return null;
    }
 
开发者ID:isisaddons-legacy,项目名称:isis-module-excel,代码行数:24,代码来源:CellMarshaller.java


示例3: appliesTo

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
@Override
public ApplicationAdvice appliesTo(IModel<?> model) {
    
    if(!internetReachable()) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }
    
    if (!(model instanceof EntityCollectionModel)) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }

    EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;

    ObjectSpecification typeOfSpec = entityCollectionModel.getTypeOfSpecification();
    ObjectSpecification locatableSpec = getSpecificationLoader().loadSpecification(Locatable.class);
    return appliesIf(typeOfSpec.isOfType(locatableSpec));
}
 
开发者ID:IUSISProyecto,项目名称:IUSIS,代码行数:18,代码来源:CollectionOfEntitiesAsLocatablesFactory.java


示例4: appliesTo

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
@Override
public ApplicationAdvice appliesTo(final IModel<?> model) {
    
    if (!(model instanceof ValueModel)) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }
    final ValueModel valueModel = (ValueModel) model;
    if(model.getObject() == null) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }
    
    final ObjectSpecification chartOptionsSpec = getSpecificationLoader().loadSpecification(WickedChart.class);
    final ObjectSpecification scalarSpec = valueModel.getObject().getSpecification();
    
    return appliesExclusivelyIf(scalarSpec.isOfType(chartOptionsSpec));
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-wickedcharts,代码行数:17,代码来源:StandaloneValueAsWickedChartFactory.java


示例5: asJson

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
/**
 * not API
 */
public String asJson(final ObjectSpecification objectSpec) {
    final LayoutMetadata metadata = new LayoutMetadata();
    metadata.setColumns(Lists.<ColumnRepr>newArrayList());
    
    final MemberGroupLayoutFacet mglf = objectSpec.getFacet(MemberGroupLayoutFacet.class);
    final ColumnSpans columnSpans = mglf.getColumnSpans();
    
    final Set<String> actionIdsForAssociations = Sets.newTreeSet();
    
    ColumnRepr columnRepr;
    
    columnRepr = addColumnWithSpan(metadata, columnSpans.getLeft());
    updateColumnMemberGroups(objectSpec, MemberGroupLayoutHint.LEFT, columnRepr);
    
    columnRepr = addColumnWithSpan(metadata, columnSpans.getMiddle());
    updateColumnMemberGroups(objectSpec, MemberGroupLayoutHint.MIDDLE, columnRepr);
    
    columnRepr = addColumnWithSpan(metadata, columnSpans.getRight());
    updateColumnMemberGroups(objectSpec, MemberGroupLayoutHint.RIGHT, columnRepr);
    
    columnRepr = addColumnWithSpan(metadata, columnSpans.getCollections());
    updateCollectionColumnRepr(objectSpec, columnRepr);

    addActions(objectSpec, metadata, actionIdsForAssociations);
    
    final Gson gson = new GsonBuilder().setPrettyPrinting().create();
    return gson.toJson(metadata);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:32,代码来源:LayoutJsonExporter.java


示例6: updateCollectionColumnRepr

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private static void updateCollectionColumnRepr(final ObjectSpecification objectSpec, final ColumnRepr columnRepr) {
    final List<ObjectAssociation> objectAssociations = collectionsOf(objectSpec);
    columnRepr.collections = Maps.newLinkedHashMap();
    for(final ObjectAssociation assoc: objectAssociations) {
        final MemberRepr memberRepr = newMemberRepr(assoc);
        columnRepr.collections.put(assoc.getId(), memberRepr);
    }
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:9,代码来源:LayoutJsonExporter.java


示例7: addActions

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private static void addActions(final ObjectSpecification objectSpec, final LayoutMetadata metadata, final Set<String> actionIdsForAssociations) {
    final Map<String, ActionRepr> actions = Maps.newLinkedHashMap();
    final List<ObjectAction> actionsOf = actionsOf(objectSpec, actionIdsForAssociations);
    for(final ObjectAction action: actionsOf) {
        actions.put(action.getId(), newActionRepr(action));
    }
    metadata.setActions(actions);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:9,代码来源:LayoutJsonExporter.java


示例8: getClassType

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
public String getClassType() {
    boolean service = false;
    for(ObjectSpecification subspecs: spec.subclasses()) {
        service = service || subspecs.isService();
    }
    return service || spec.isService() ?"2 Service":spec.isValue()?"3 Value":spec.isParentedOrFreeCollection()?"4 Collection":"1 Object";
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:8,代码来源:MetaModelRow.java


示例9: getContributedBy

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
public String getContributedBy() {
    if(member instanceof ContributeeMember2) {
        final ObjectSpecification serviceContributedBy = ((ContributeeMember2) member).getServiceContributedBy();
        return serviceContributedBy.getCorrespondingClass().getSimpleName();
    }
    return "";
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:8,代码来源:MetaModelRow.java


示例10: refreshServices

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
@Programmatic
public void refreshServices() {
    final Collection<ObjectSpecification> specifications = Lists.newArrayList(specificationLoader.allSpecifications());
    for (final ObjectSpecification objectSpec : specifications) {
        if(objectSpec.isService()){
            specificationLoader.invalidateCache(objectSpec.getCorrespondingClass());
        }
    }
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:10,代码来源:DeveloperUtilitiesServiceProgrammatic.java


示例11: downloadLayouts

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
@Programmatic
public Blob downloadLayouts() {
    final LayoutJsonExporter exporter = new LayoutJsonExporter();
    final Collection<ObjectSpecification> allSpecs = specificationLoader.allSpecifications();
    final Collection<ObjectSpecification> domainObjectSpecs = Collections2.filter(allSpecs, new Predicate<ObjectSpecification>(){
        @Override
        public boolean apply(final ObjectSpecification input) {
            return  !input.isAbstract() && 
                    !input.isService() && 
                    !input.isValue() && 
                    !input.isParentedOrFreeCollection();
        }});
    try {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ZipOutputStream zos = new ZipOutputStream(baos);
        final OutputStreamWriter writer = new OutputStreamWriter(zos);
        for (final ObjectSpecification objectSpec : domainObjectSpecs) {
            zos.putNextEntry(new ZipEntry(zipEntryNameFor(objectSpec)));
            writer.write(exporter.asJson(objectSpec));
            writer.flush();
            zos.closeEntry();
        }
        writer.close();
        return new Blob("layouts.zip", mimeTypeApplicationZip, baos.toByteArray());
    } catch (final IOException ex) {
        throw new FatalException("Unable to create zip of layouts", ex);
    }
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:29,代码来源:DeveloperUtilitiesServiceProgrammatic.java


示例12: getAssociation

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private static OneToOneAssociation getAssociation(final ObjectSpecification objectSpec, final String propertyNameOrId) {
    final List<ObjectAssociation> associations = objectSpec.getAssociations(Contributed.INCLUDED);
    for (final ObjectAssociation association : associations) {
        if (association instanceof OneToOneAssociation) {
            if (propertyNameOrId.equalsIgnoreCase(association.getName())) {
                return (OneToOneAssociation) association;
            }
            if (propertyNameOrId.equalsIgnoreCase(association.getId())) {
                return (OneToOneAssociation) association;
            }
        }
    }
    return null;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-excel,代码行数:15,代码来源:ExcelConverter.java


示例13: setCellValue

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
void setCellValue(
        final ObjectAdapter objectAdapter, 
        final OneToOneAssociation otoa, 
        final Cell cell) {
    
    final ObjectAdapter propertyAdapter = otoa.get(objectAdapter);
    
    // null
    if (propertyAdapter == null) {
        cell.setCellType(HSSFCell.CELL_TYPE_BLANK);
        return;
    }
    
    final ObjectSpecification propertySpec = otoa.getSpecification();
    final Object propertyAsObj = propertyAdapter.getObject();
    final String propertyAsTitle = propertyAdapter.titleString(null);
    
    // value types
    if(propertySpec.isValue()) {
        if(setCellValue(cell, propertyAsObj)) {
            return;
        }
    }
    
    // reference types
    if(!propertySpec.isParentedOrFreeCollection()) {
        setCellValueForBookmark(cell, propertyAsObj, propertyAsTitle);
        return;
    }

    // fallback, best effort
    setCellValueForString(cell, propertyAsTitle);
    return;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-excel,代码行数:35,代码来源:CellMarshaller.java


示例14: choices0NewDocFragment

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
public List<String> choices0NewDocFragment() {
    final Collection<ObjectSpecification> objectSpecifications = specificationLookup.allSpecifications();
    return Lists.newArrayList(
            FluentIterable.from(objectSpecifications)
                    .filter(x -> !(x.isValue() || x.isService() || x.isAbstract() || x.isMixin() || x.isParentedOrFreeCollection()))
            .transform(x -> x.getSpecId().asString())
            .toSortedList(String::compareTo)
    );
}
 
开发者ID:estatio,项目名称:estatio,代码行数:10,代码来源:DocFragmentMenu.java


示例15: choices0CreateDocFragment

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
public List<String> choices0CreateDocFragment() {
    final Collection<ObjectSpecification> objectSpecifications = specificationLookup.allSpecifications();
    return Lists.newArrayList(
            FluentIterable.from(objectSpecifications)
            .transform(x -> x.getSpecId().asString())
            .toSortedList(String::compareTo)
    );
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:DocFragmentMenu.java


示例16: appliesTo

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
@Override
public ApplicationAdvice appliesTo(final IModel<?> model) {
    if(!(model instanceof EntityCollectionModel)) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }
    final EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;
    // TOFIX: because of Javascript issues, currently only works for standalone views.
    if(!entityCollectionModel.isStandalone()) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }
    final ObjectSpecification elementSpec = entityCollectionModel.getTypeOfSpecification();
    List<ObjectAssociation> associations = elementSpec.getAssociations(OF_TYPE_BIGDECIMAL);
    return appliesIf(!associations.isEmpty());
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-wickedcharts,代码行数:15,代码来源:CollectionContentsAsSummaryChartFactory.java


示例17: buildGui

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private void buildGui() {
    final EntityCollectionModel model = getModel();

    final ObjectSpecification elementSpec = model.getTypeOfSpecification();

    final NotificationPanel feedback = new NotificationPanel(ID_FEEDBACK);
    feedback.setOutputMarkupId(true);
    addOrReplace(feedback);

    final List<ObjectAdapter> adapters = model.getObject();
    final List<String> titles = Lists.newArrayList();
    for (ObjectAdapter adapter: adapters) {
        titles.add(adapter.titleString(null));
    }

    final List<ObjectAssociation> numberAssociations = elementSpec.getAssociations(CollectionContentsAsSummaryChartFactory.OF_TYPE_BIGDECIMAL);
    final List<CollectionContentsAsSummary.Summary> summaries = Lists.newArrayList();
    for (final ObjectAssociation numberAssociation : numberAssociations) {

        final String propertyName = numberAssociation.getName();
        final CollectionContentsAsSummary.Summary summary = new CollectionContentsAsSummary.Summary(propertyName, adapters, numberAssociation);

        summaries.add(summary);
    }

    if(model.isStandalone()) {
        final WickedChart chartValue = createChartValue(titles, summaries);
        final StandaloneValueAsWickedChart wickedChart = new StandaloneValueAsWickedChart(ID_CHART, asValueModel(chartValue));
        addOrReplace(wickedChart);
    } else {
        add(new Label(ID_CHART, ""));
    }
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-wickedcharts,代码行数:34,代码来源:CollectionContentsAsSummaryChart.java


示例18: appliesTo

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
@Override
public ApplicationAdvice appliesTo(final IModel<?> model) {
    if(!(model instanceof EntityCollectionModel)) {
        return ApplicationAdvice.DOES_NOT_APPLY;
    }
    final EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;
    
    final ObjectSpecification elementSpec = entityCollectionModel.getTypeOfSpecification();
    final Class<?> correspondingClass = elementSpec.getCorrespondingClass();
    
    return appliesIf(cls.isAssignableFrom(correspondingClass));
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-fullcalendar2,代码行数:13,代码来源:CalendaredCollectionFactoryAbstract.java


示例19: propertiesOf

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private static List<ObjectAssociation> propertiesOf(final ObjectSpecification objSpec) {
    return objSpec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.PROPERTIES);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:4,代码来源:LayoutJsonExporter.java


示例20: collectionsOf

import org.apache.isis.core.metamodel.spec.ObjectSpecification; //导入依赖的package包/类
private static List<ObjectAssociation> collectionsOf(final ObjectSpecification objSpec) {
    return objSpec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.COLLECTIONS);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-devutils,代码行数:4,代码来源:LayoutJsonExporter.java



注:本文中的org.apache.isis.core.metamodel.spec.ObjectSpecification类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DirectedGraphLayout类代码示例发布时间:2022-05-23
下一篇:
Java MalformedURIException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap