public boolean isReadable() { return _delegate.isReadable(); }
public boolean isReadable() { return _source.isReadable(); }
public boolean isReadable() { return _source.isReadable(); }
public boolean isReadable() { return _delegate.isReadable(); }
default boolean isReadable( IType whosAskin ) { return isReadable(); }
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" ); } }
protected boolean hasReturn() { IFeatureInfo fi = getFeatureInfo(); return fi instanceof IMethodInfo ? ((IMethodInfo)fi).getReturnType() != JavaTypes.pVOID() : fi == null || fi instanceof IConstructorInfo || fi instanceof IPropertyInfo && ((IPropertyInfo)fi).isReadable( fi.getOwnersType() ); } }
private void addAll( Object contextValue, IPropertyInfo pi ) { Collection value = (Collection)getValue( pi ); Collection existingCollection = null; if( pi.isReadable() ) { existingCollection = (Collection)pi.getAccessor().getValue( contextValue ); } if( existingCollection != null ) { //noinspection unchecked existingCollection.addAll( value ); } else { throw new EvaluationException( getPropertyName() + ", on class, " + TypeSystem.getUnqualifiedClassName( getOwnerType() ) + "is not writable and does not have a current Collection value to add values to." ); } }
private void addAll( Object contextValue, IPropertyInfo pi ) { Collection value = (Collection)getValue( pi ); Collection existingCollection = null; if( pi.isReadable() ) { existingCollection = (Collection)pi.getAccessor().getValue( contextValue ); } if( existingCollection != null ) { //noinspection unchecked existingCollection.addAll( value ); } else { throw new EvaluationException( getPropertyName() + ", on class, " + TypeSystem.getUnqualifiedClassName( getOwnerType() ) + "is not writable and does not have a current Collection value to add values to." ); } }
public static boolean isPropertySetter( IMethodInfo mi ) { String strMethod = mi.getDisplayName(); if( strMethod.startsWith( "set" ) && strMethod.length() > 3 && mi.getParameters().length == 1 && mi.getReturnType() == JavaTypes.pVOID() ) { String strProp = strMethod.substring( "set".length() ); if( Character.isUpperCase( strProp.charAt( 0 ) ) ) { ITypeInfo ti = (ITypeInfo)mi.getContainer(); IPropertyInfo pi = ti instanceof IRelativeTypeInfo ? ((IRelativeTypeInfo)ti).getProperty( mi.getOwnersType(), strProp ) : ti.getProperty( strProp ); if( pi != null && pi.isReadable() && mi.isStatic() == pi.isStatic() && getGenericType( pi ).getName().equals( getGenericParameters( mi )[0].getFeatureType().getName() ) ) { return !Keyword.isKeyword( pi.getName() ) || Keyword.isValueKeyword( pi.getName() ); } } } return false; }
mi = pi.isReadable( getGosuClass() ) ? ((IJavaPropertyInfo)pi).getReadMethodInfo() : null; mi = pi.isReadable( getGosuClass() ) ? ((IJavaPropertyInfo)pi).getReadMethodInfo() : null; if( mi == null || mi.getReturnType() != JavaTypes.pBOOLEAN() && mi.getReturnType() != JavaTypes.BOOLEAN() )
private void checkMemberAccessIsReadable() { Expression expr = peekExpression(); if( expr instanceof MemberAccess ) { IPropertyInfo pi = ((MemberAccess)expr).getPropertyInfoWithoutThrowing(); if( pi != null ) { verify( expr, pi.isReadable( getGosuClass() ), Res.MSG_CLASS_PROPERTY_NOT_READABLE, pi.getName(), pi.getOwnersType().getName() ); } } else if( (expr instanceof Identifier && ((Identifier)expr).getSymbol() instanceof DynamicPropertySymbol) ) { DynamicPropertySymbol dps = (DynamicPropertySymbol)((Identifier)expr).getSymbol(); if( dps != null && dps.getPropertyInfo() != null && !dps.getPropertyInfo().isReadable( getGosuClass() ) ) { verify( expr, false, Res.MSG_CLASS_PROPERTY_NOT_READABLE, dps.getName(), dps.getScriptPart() == null ? "" : dps.getScriptPart().getContainingType().getName() ); } } }
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; }
private void checkMemberAccessIsReadable() { Expression expr = peekExpression(); if( expr instanceof MemberAccess ) { IPropertyInfo pi = ((MemberAccess)expr).getPropertyInfoWithoutThrowing(); if( pi != null ) { verify( expr, pi.isReadable(), Res.MSG_CLASS_PROPERTY_NOT_READABLE, pi.getName(), pi.getOwnersType().getName() ); } } else if( (expr instanceof Identifier && ((Identifier)expr).getSymbol() instanceof DynamicPropertySymbol) ) { DynamicPropertySymbol dps = (DynamicPropertySymbol)((Identifier)expr).getSymbol(); if( dps != null && !dps.isReadable() ) { verify( expr, dps.isReadable(), Res.MSG_CLASS_PROPERTY_NOT_READABLE, dps.getName(), dps.getScriptPart() == null ? "" : dps.getScriptPart().getContainingType().getName() ); } } }
if( pi instanceof IGosuPropertyInfo ) IFunctionType funcType = pi.isReadable( getGosuClass() ) ? (IFunctionType)((IGosuPropertyInfo)pi).getDps().getGetterDfs().getType() : (IFunctionType)((IGosuPropertyInfo)pi).getDps().getSetterDfs().getType();