@SuppressWarnings({"unchecked"}) public List<IAnnotationInfo> getAnnotationsOfType( IType type ) { return _source.getAnnotationsOfType( type ); }
@SuppressWarnings({"unchecked"}) public List<IAnnotationInfo> getAnnotationsOfType( IType type ) { return _source.getAnnotationsOfType( type ); }
private static String getShortName(IPropertyInfo propertyInfo) { String shortName = makeCmdLineOptionName( propertyInfo ); if (propertyInfo.hasAnnotation(TypeSystem.get(ShortName.class))) { IAnnotationInfo annotation = propertyInfo.getAnnotationsOfType( TypeSystem.get( ShortName.class ) ).get( 0 ); ShortName value = (ShortName)annotation.getInstance(); shortName = value.name(); } return shortName; }
private static String getLongName(IPropertyInfo propertyInfo) { String shortName = makeCmdLineOptionName( propertyInfo ); if (propertyInfo.hasAnnotation(TypeSystem.get(LongName.class))) { IAnnotationInfo annotation = propertyInfo.getAnnotationsOfType( TypeSystem.get( LongName.class ) ).get( 0 ); LongName value = (LongName)annotation.getInstance(); shortName = value.name(); } return shortName; }
private boolean mightRequireAutoCreation(IType rootType, IPropertyInfo pi) { if(_expr().getExpressionRuntime() instanceof SinglePropertyMemberAccessRuntime) { if (((SinglePropertyMemberAccessRuntime) _expr().getExpressionRuntime()).isNestedInLhs()) { // The property in the path is null; attempt to dynamically set its value if @Autocreate annotation is present IType autocreateAnnotationType = GosuTypes.AUTOCREATE(); List<IAnnotationInfo> list = pi.getAnnotationsOfType( autocreateAnnotationType ); if (list != null && !list.isEmpty()) { return true; } else if( rootType instanceof IPlaceholder && ((IPlaceholder)rootType).isPlaceholder() ) { return true; } else { // TODO dlank - With a bit of work, the following can be replaced by adding @Autocreate annotations to the EntityTypeInfo's properties IEntityAccess ea = CommonServices.getEntityAccess(); if( ea.isEntityClass( rootType ) && ea.isEntityClass(pi.getFeatureType())) { return true; } } } } return false; }
IEntityAccess ea = CommonServices.getEntityAccess(); List<IAnnotationInfo> annotationInfoList = property.getAnnotationsOfType( GosuTypes.AUTOCREATE() ); Object value; boolean usingAutoCreateAnnotation = annotationInfoList != null && annotationInfoList.size() > 0;
private boolean mightRequireAutoCreation(IType rootType, IPropertyInfo pi) { if(_expr().getExpressionRuntime() instanceof SinglePropertyMemberAccessRuntime) { if (((SinglePropertyMemberAccessRuntime) _expr().getExpressionRuntime()).isNestedInLhs()) { // The property in the path is null; attempt to dynamically set its value if @Autocreate annotation is present IType autocreateAnnotationType = GosuTypes.AUTOCREATE(); List<IAnnotationInfo> list = pi.getAnnotationsOfType( autocreateAnnotationType ); if (list != null && !list.isEmpty()) { return true; } else if( rootType instanceof IPlaceholder && ((IPlaceholder)rootType).isPlaceholder() ) { return true; } else { // TODO dlank - With a bit of work, the following can be replaced by adding @Autocreate annotations to the EntityTypeInfo's properties IEntityAccess ea = CommonServices.getEntityAccess(); if( ea.isEntityClass( rootType ) && ea.isEntityClass(pi.getFeatureType())) { return true; } } } } return false; }
String defaultValue = null; if (propertyInfo.hasAnnotation(TypeSystem.get(DefaultValue.class))) { IAnnotationInfo annotationInfo = propertyInfo.getAnnotationsOfType( TypeSystem.get( DefaultValue.class ) ).get( 0 ); defaultValue = ((DefaultValue)annotationInfo.getInstance()).value();
List<IAnnotationInfo> list = autoinsertAnnotationType == null ? null : memberAccess.getPropertyInfo().getAnnotationsOfType( autoinsertAnnotationType ); if( list == null || list.isEmpty() )
List<IAnnotationInfo> list = autoinsertAnnotationType == null ? null : memberAccess.getPropertyInfo().getAnnotationsOfType( autoinsertAnnotationType ); if( list == null || list.isEmpty() )
ArgNames argNames = (ArgNames)propertyInfo.getAnnotationsOfType( TypeSystem.get( ArgNames.class ) ).get( 0 ).getInstance(); if (argNames.names() != null && argNames.names().length > 0) { String compoundNames = ""; Separator argNames = (Separator)propertyInfo.getAnnotationsOfType( TypeSystem.get( Separator.class ) ).get( 0 ).getInstance(); opt.setValueSeparator( argNames.value().charAt( 0 ) ); opt.setType( propertyInfo.getFeatureType().getName() ); if (propertyInfo.hasAnnotation(TypeSystem.get(ArgNames.class))) { ArgNames argNames = (ArgNames)propertyInfo.getAnnotationsOfType( TypeSystem.get( ArgNames.class ) ).get( 0 ).getInstance(); if (argNames.names() != null && argNames.names().length > 0) { opt.setArgName( argNames.names()[0] );
IEntityAccess ea = CommonServices.getEntityAccess(); List<IAnnotationInfo> annotationInfoList = property.getAnnotationsOfType( GosuTypes.AUTOCREATE() ); Object value; boolean usingAutoCreateAnnotation = annotationInfoList != null && annotationInfoList.size() > 0;