当前位置: 首页>>代码示例>>Java>>正文


Java DataObject.getProperties方法代码示例

本文整理汇总了Java中org.kie.workbench.common.services.datamodeller.core.DataObject.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java DataObject.getProperties方法的具体用法?Java DataObject.getProperties怎么用?Java DataObject.getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kie.workbench.common.services.datamodeller.core.DataObject的用法示例。


在下文中一共展示了DataObject.getProperties方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isUniqueAttributeName

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public void isUniqueAttributeName( String name,
        DataObject object,
        ValidatorWithReasonCallback callback ) {
    for ( ObjectProperty prop : object.getProperties() ) {
        if ( prop.getName().equalsIgnoreCase( name ) ) {
            callback.onFailure( MANAGED_PROPERTY_EXISTS );
            return;
        }
    }
    for ( ObjectProperty unmanagedProp : object.getUnmanagedProperties() ) {
        if ( unmanagedProp.getName().equalsIgnoreCase( name ) ) {
            callback.onFailure( UN_MANAGED_PROPERTY_EXISTS );
            return;
        }
    }
    callback.onSuccess();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:ValidatorService.java

示例2: getFieldsUsingPosition

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static List<ObjectProperty> getFieldsUsingPosition( DataObject dataObject,
                                                           int position,
                                                           String skipField ) {
    List<ObjectProperty> fields = new ArrayList<ObjectProperty>();
    if ( dataObject != null && dataObject.getProperties() != null ) {
        for ( ObjectProperty property : dataObject.getProperties() ) {

            if ( skipField != null && skipField.equals( property.getName() ) ) {
                continue;
            }

            String currentPosition = AnnotationValueHandler.getStringValue(
                    property.getAnnotation( DroolsDomainAnnotations.POSITION_ANNOTATION ),
                    DroolsDomainAnnotations.VALUE_PARAM );
            if ( currentPosition != null && currentPosition.trim().equals( position + "" ) ) {
                fields.add( property );
            }
        }
    }
    return fields;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:DataModelerUtils.java

示例3: resolveAllFieldsConstructor

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public String resolveAllFieldsConstructor( DataObject dataObject, String indent ) {
    if ( !dataObject.getProperties().isEmpty() ) {
        List<ObjectProperty> sortedProperties = new ArrayList<ObjectProperty>();
        for ( ObjectProperty property : dataObject.getProperties() ) {
            if ( DataModelUtils.isAssignable( property ) ) {
                sortedProperties.add( property );
            }
        }

        if ( sortedProperties.size() > 0 && sortedProperties.size() < MAX_FIELDS_FOR_DEFAULT_CONSTRUCTOR ) {
            //condition used by drools. All fields constructor is generated only if a class has less than
            // MAX_FIELDS_FOR_DEFAULT_CONSTRUCTOR
            return resolveConstructor( dataObject, DataModelUtils.sortByPosition( sortByName( sortedProperties ) ), indent );
        }
    }
    return "";
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:GenerationTools.java

示例4: isReferencedByCurrentObject

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public boolean isReferencedByCurrentObject( DataObject referencedObject,
        DataObject currentObject ) {

    if ( currentObject.getSuperClassName() != null && currentObject.getSuperClassName().equals( referencedObject.getClassName() )) return true;

    if ( currentObject.getProperties() != null ) {
        for ( ObjectProperty propertyTO : currentObject.getProperties() ) {
            if ( propertyTO.getClassName().equals( referencedObject.getClassName() ) ) return true;
        }
    }
    return false;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:13,代码来源:ValidatorService.java

示例5: reset

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
private void reset() {
    referencedBy.clear();
    references.clear();
    classNames.clear();
    labelledClassNames.clear();
    offspringMap.clear();
    if (dataModel != null) {
        for (DataObject extClassName : dataModel.getExternalClasses()) {
            classNames.put(extClassName.getClassName(), null);
            labelledClassNames.put(extClassName.getClassName(), extClassName.getClassName());
        }
        for (DataObject object : dataModel.getDataObjects()) {
            String className = object.getClassName();
            classNames.put(className, AnnotationValueHandler.getStringValue( object, MainDomainAnnotations.LABEL_ANNOTATION ));
            labelledClassNames.put(DataModelerUtils.getDataObjectFullLabel(object), className);

            String superClassName = object.getSuperClassName();
            if (superClassName != null &&  !"".equals(superClassName)) objectExtended(superClassName, className, true);

            for (ObjectProperty prop : object.getProperties()) {
                if (!prop.isBaseType()) {
                    objectReferenced(prop.getClassName(), object.getClassName());
                }
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:28,代码来源:DataModelHelper.java

示例6: hasIdField

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
private boolean hasIdField( DataObject dataObject ) {
    for ( ObjectProperty objectProperty : dataObject.getProperties() ) {
        if ( objectProperty.getAnnotation( JPADomainAnnotations.JAVAX_PERSISTENCE_ID_ANNOTATION ) != null ) {
            return true;
        }
    }
    return false;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:9,代码来源:JPADataObjectEditor.java

示例7: persistenceConfigurableFields

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
private List<ObjectProperty> persistenceConfigurableFields( DataObject dataObject ) {
    List<ObjectProperty> result = new ArrayList<ObjectProperty>(  );
    for ( ObjectProperty field : dataObject.getProperties() ) {
        if ( DataModelerUtils.isManagedProperty( field ) && ( field.isMultiple() || !field.isBaseType() ) ) {
            result.add( field );
        }
    }
    return result;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:10,代码来源:JPADataObjectEditor.java

示例8: resolvePositionFieldsConstructor

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public String resolvePositionFieldsConstructor( DataObject dataObject ) {
    if ( !dataObject.getProperties().isEmpty() ) {
        List<ObjectProperty> sortedProperties = new ArrayList<ObjectProperty>();
        for ( ObjectProperty property : dataObject.getProperties() ) {
            if ( DataModelUtils.isAssignable( property ) && DataModelUtils.isPositionField( property ) ) {
                //the property is marked as key.
                sortedProperties.add( property );
            }
        }
        if ( sortedProperties.size() > 0 && sortedProperties.size() < MAX_FIELDS_FOR_DEFAULT_CONSTRUCTOR ) {
            return resolveConstructor2( dataObject, DataModelUtils.sortByPosition( sortedProperties ), "    " );
        }
    }
    return "";
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:16,代码来源:GenerationTools.java

示例9: getManagedProperties

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static List<ObjectProperty> getManagedProperties( DataObject dataObject ) {
    List<ObjectProperty> editableProperties = new ArrayList<ObjectProperty>();

    if ( dataObject != null && dataObject.getProperties() != null ) {
        for ( ObjectProperty property : dataObject.getProperties() ) {
            if ( isManagedProperty( property ) ) {
                editableProperties.add( property );
            }
        }
    }
    return editableProperties;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:13,代码来源:DataModelerUtils.java

示例10: resolveKeyFieldsConstructor

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public String resolveKeyFieldsConstructor( DataObject dataObject ) {
    if ( !dataObject.getProperties().isEmpty() ) {
        List<ObjectProperty> sortedProperties = new ArrayList<ObjectProperty>();
        for ( ObjectProperty property : dataObject.getProperties() ) {
            if ( DataModelUtils.isAssignable( property ) && DataModelUtils.isKeyField( property ) ) {
                //the property is marked as key.
                sortedProperties.add( property );
            }
        }
        if ( sortedProperties.size() > 0 && sortedProperties.size() < MAX_FIELDS_FOR_DEFAULT_CONSTRUCTOR ) {
            return resolveConstructor2( dataObject, DataModelUtils.sortByFileOrder( sortedProperties ), "    " );
        }
    }
    return "";
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:16,代码来源:GenerationTools.java

示例11: filterAssignableFields

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static List<ObjectProperty> filterAssignableFields( DataObject dataObject ) {
    List<ObjectProperty> result = new ArrayList<ObjectProperty>();
    if ( dataObject.getProperties() != null && dataObject.getProperties().size() > 0 ) {
        result.addAll( dataObject.getProperties() );
        result = filterAssignableFields( result );
    }
    return result;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:9,代码来源:DataModelUtils.java

示例12: filterKeyFields

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static List<ObjectProperty> filterKeyFields( DataObject dataObject ) {
    List<ObjectProperty> result = new ArrayList<ObjectProperty>();
    if ( dataObject.getProperties() != null && dataObject.getProperties().size() > 0 ) {
        result.addAll( dataObject.getProperties() );
        result = filterKeyFields( result );
    }
    return result;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:9,代码来源:DataModelUtils.java

示例13: filterPositionFields

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static List<ObjectProperty> filterPositionFields( DataObject dataObject ) {
    List<ObjectProperty> result = new ArrayList<ObjectProperty>();
    if ( dataObject.getProperties() != null && dataObject.getProperties().size() > 0 ) {
        result.addAll( dataObject.getProperties() );
        result = filterPositionFields( result );
    }
    return result;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:9,代码来源:DataModelUtils.java

示例14: positionFieldsCount

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static int positionFieldsCount( DataObject dataObject ) {
    int result = 0;
    for ( ObjectProperty property : dataObject.getProperties() ) {
        if ( isPositionField( property ) ) {
            result++;
        }
    }
    return result;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:10,代码来源:DataModelUtils.java

示例15: assignableFieldsCount

import org.kie.workbench.common.services.datamodeller.core.DataObject; //导入方法依赖的package包/类
public static int assignableFieldsCount( DataObject dataObject ) {
    int result = 0;
    for ( ObjectProperty property : dataObject.getProperties() ) {
        if ( isAssignable( property ) ) {
            result++;
        }
    }
    return result;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:10,代码来源:DataModelUtils.java


注:本文中的org.kie.workbench.common.services.datamodeller.core.DataObject.getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。