本文整理汇总了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();
}
示例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;
}
示例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 "";
}
示例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;
}
示例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());
}
}
}
}
}
示例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;
}
示例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;
}
示例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 "";
}
示例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;
}
示例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 "";
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}