public boolean isWritable(IType whosAskin) { return _source.isWritable(whosAskin); }
public boolean isWritable(IType whosAskin) { return _source.isWritable(whosAskin); }
private boolean shouldReplace( PropertyNameMap<T> props, T cs, IPropertyInfo propertyInfo ) { IPropertyInfo pi = props.get( cs ); if( pi == null ) { return true; } if( propertyInfo.isReadable() && propertyInfo.isWritable( _typeInfo.getOwnersType() ) ) { return !pi.isReadable() || !pi.isWritable(); } return false; }
protected Map<String,IPropertyInfo> getProperties(IType type) { Map<String, IPropertyInfo> rtn = new TreeMap<String,IPropertyInfo>(); ITypeInfo typeInfo = type.getTypeInfo(); if (typeInfo instanceof IRelativeTypeInfo) { IRelativeTypeInfo pogoTI = ((IRelativeTypeInfo) typeInfo); for (IPropertyInfo property : pogoTI.getDeclaredProperties()) { if (property.isPublic() && property.isWritable() && property.isReadable()) { rtn.put(property.getName(), property); } } } return rtn; }
protected Map<String,IPropertyInfo> getProperties(IType type) { Map<String, IPropertyInfo> rtn = new TreeMap<String,IPropertyInfo>(); ITypeInfo typeInfo = type.getTypeInfo(); if (typeInfo instanceof IRelativeTypeInfo) { IRelativeTypeInfo pogoTI = ((IRelativeTypeInfo) typeInfo); for (IPropertyInfo property : pogoTI.getProperties(_gwRemotableType.get())) { if (property.isPublic() && property.isWritable() && property.isReadable()) { rtn.put(property.getName(), property); } } } return rtn; }
private void genInterfacePropertyDecl( StringBuilder sb, IPropertyInfo pi ) { if( pi.isStatic() ) { genStaticProperty( pi, sb ); return; } if( !pi.isReadable() ) { return; } if( !(pi instanceof JavaBaseFeatureInfo) ) { // It is possible that a methodinfo on a java type originates outside of java. // E.g., enhancement methods. Gosu does not support extending these. return; } IType type = getGenericType( pi ); if( pi.getDescription() != null ) { sb.append( "\n/** " ).append( pi.getDescription() ).append( " */\n" ); } sb.append( " property get " ).append( pi.getName() ).append( "() : " ).append( type.getName() ).append( "\n" ); if( pi.isWritable( pi.getOwnersType() ) ) { sb.append( " property set " ).append( pi.getName() ).append( "( _proxy_arg_value : " ).append( type.getName() ).append( " )\n" ); } }
if( pi.isWritable( pi.getOwnersType() ) ) { sb.append( " property set " ).append( pi.getName() ).append( "( value: " ).append( ifacePropertyType.getName() ).append( " ) {\n" ); if( bPrivate ) {
if( pi.isWritable( pi.getOwnersType() ) )
if( pi.isWritable( pi.getOwnersType() ) )
if( pi.isWritable( pi.getOwnersType() ) )
private void verifyPropertyWritable( IType classRoot, String strProperty, boolean bFromObjInitializer ) throws ParseException { if( classRoot == null ) { throw new IllegalArgumentException( "Root class is null|" ); } if( strProperty == null ) { throw new IllegalArgumentException( "Bean member path is null!" ); } IPropertyInfo pi = BeanAccess.getPropertyInfo( classRoot, strProperty, null, null, null ); if( pi != null ) { if( !BeanAccess.isDescriptorHidden( pi ) ) { if( !pi.isWritable( getGosuClass() ) ) { if( bFromObjInitializer || !(isParsingConstructor() && pi instanceof IGosuVarPropertyInfo && pi.isFinal() && !pi.isStatic()) ) { throw new ParseException( makeFullParserState(), Res.MSG_CLASS_PROPERTY_NOT_WRITABLE, strProperty, TypeSystem.getUnqualifiedClassName( classRoot )); } } return; } } throw new IllegalArgumentException( "No property descriptor found for property, " + strProperty + ", on class, " + TypeSystem.getUnqualifiedClassName( classRoot ) ); }
private void verifyPropertyWritable( IType classRoot, String strProperty, boolean bFromObjInitializer ) throws ParseException { if( classRoot == null ) { throw new IllegalArgumentException( "Root class is null|" ); } if( strProperty == null ) { throw new IllegalArgumentException( "Bean member path is null!" ); } IPropertyInfo pi = BeanAccess.getPropertyInfo( classRoot, strProperty, null, null, null ); if( pi != null ) { if( !BeanAccess.isDescriptorHidden( pi ) ) { if( !pi.isWritable( getGosuClass() ) ) { if( bFromObjInitializer || !(isParsingConstructor() && pi instanceof IGosuVarPropertyInfo && pi.isFinal() && !pi.isStatic()) ) { throw new ParseException( makeFullParserState(), Res.MSG_CLASS_PROPERTY_NOT_WRITABLE, strProperty, TypeSystem.getUnqualifiedClassName( classRoot )); } } return; } } throw new IllegalArgumentException( "No property descriptor found for property, " + strProperty + ", on class, " + TypeSystem.getUnqualifiedClassName( classRoot ) ); }
@Override public boolean acceptFeature( IType beanType, IFeatureInfo fi ) { if( fi instanceof IPropertyInfo ) { IPropertyInfo pi = (IPropertyInfo)fi; if( pi.isWritable( null ) || JavaTypes.COLLECTION().isAssignableFrom( pi.getFeatureType() ) || JavaTypes.MAP().isAssignableFrom( pi.getFeatureType() ) ) { return true; } } return false; } } );
private static Object deepCopyJSchemaObject(Stack<String> propertyPath, IJSchemaType toType, JsonMap from, IJSchemaType fromType, IdentityHashMap<Object, Object> serializationMap) { JsonMap to = new JsonMap(toType); serializationMap.put(from, to); List<? extends IPropertyInfo> properties = toType.getTypeInfo().getProperties(); for (IPropertyInfo property : properties) { if (property.isWritable()) { String toSlotName = toType.getJsonSlotForPropertyName(property.getName()); String fromSlotName = fromType.getJsonSlotForPropertyName(property.getName()); IType fromPropertyType = fromType.getTypeForJsonSlot(fromSlotName); if (toSlotName != null && fromSlotName != null) { IType toPropertyType = toType.getTypeForJsonSlot(toSlotName); Object fromSlotValue = from.get(fromSlotName); propertyPath.push(property.getName()); try { to.put(toSlotName, deepCopy(propertyPath, toPropertyType, fromSlotValue, fromPropertyType, serializationMap)); } finally { propertyPath.pop(); } } } } return to; }
if( strMemberName.startsWith( "set" ) ) mi = pi.isWritable( getGosuClass() ) ? ((IJavaPropertyInfo)pi).getWriteMethodInfo() : null;
public PropertyInfoBuilder like( IPropertyInfo prop ) { _isStatic = prop.isStatic(); _name = prop.getName(); _accessor = prop.getAccessor(); _readable = prop.isReadable(); _writable = prop.isWritable(); _type = prop.getFeatureType(); _description = prop.getDescription(); if ( prop.isDeprecated() ) { _deprecated = prop.getDeprecatedReason() == null ? "" : prop.getDeprecatedReason(); } else { _deprecated = null; } _annotations = prop.getAnnotations(); // todo dlank - any need to step through annotations and recreate 1-by-1? _locationInfo = prop.getLocationInfo(); return this; }
public PropertyInfoBuilder like( IPropertyInfo prop ) { _isStatic = prop.isStatic(); _name = prop.getName(); _accessor = prop.getAccessor(); _readable = prop.isReadable(); _writable = prop.isWritable(); _type = prop.getFeatureType(); _description = prop.getDescription(); if ( prop.isDeprecated() ) { _deprecated = prop.getDeprecatedReason() == null ? "" : prop.getDeprecatedReason(); } else { _deprecated = null; } _annotations = prop.getAnnotations(); // todo dlank - any need to step through annotations and recreate 1-by-1? if ( prop instanceof ILocationAwareFeature ) { ILocationAwareFeature locationAwareFeature = (ILocationAwareFeature) prop; _locationInfo = locationAwareFeature.getLocationInfo(); } return this; }
if( !property.isWritable() )
if( pi != null && !BeanAccess.isDescriptorHidden( pi ) ) if( !pi.isWritable() )
if( pi != null && !BeanAccess.isDescriptorHidden( pi ) ) if( !pi.isWritable() )