@Override public IPropertyInfo getProperty(CharSequence propName) { for (IPropertyInfo prop : properties) { if (propName.equals(prop.getName())) { return prop; } } return null; }
private void addTypeProperty( Map<CharSequence, IPropertyInfo> propertiesByName ) { IPropertyInfo pi = new TypeProperty(); // Only create the "Type" property if this meta-type does not have an existing static property named "Type". IPropertyInfo existing = propertiesByName.get( pi.getName() ); if( existing == null || !existing.getName().equals( pi.getName() ) ) { propertiesByName.put( pi.getName(), pi ); } }
private void addTypeProperty( Map<CharSequence, IPropertyInfo> propertiesByName ) { IPropertyInfo pi = new TypeProperty(); // Only create the "Type" property if this meta-type does not have an existing static property named "Type". IPropertyInfo existing = propertiesByName.get( pi.getName() ); if( existing == null || !existing.getName().equals( pi.getName() ) ) { propertiesByName.put( pi.getName(), pi ); } }
/** * @return */ @Override public String getName() { return _descriptor.get().getName(); }
public MyPropertyRef( ITypeInfo owner, IPropertyInfo propInfo, IType whosaskin ) { _type = owner.getOwnersType(); _name = propInfo.getName(); _whosaskin = whosaskin; _owner = owner; }
@Override public IPropertyInfo getProperty( CharSequence propName ) { for( IPropertyInfo propertyInfo : getProperties() ) { if( propertyInfo.getName().substring( 0 ).equals( propName ) ) { return propertyInfo; } } return null; }
@Override public String getName() { if( _terminalProperty.getClass() == JavaFieldPropertyInfo.class ) { return ((JavaFieldPropertyInfo)_terminalProperty).getField().getName(); } else { return _terminalProperty.getName(); } }
private void addArrayProperties(List<IPropertyInfo> ret) { if ( getOwnersType().isArray()) { for (Iterator<IPropertyInfo> iterator = ret.iterator(); iterator.hasNext();) { IPropertyInfo propertyInfo = iterator.next(); if (propertyInfo.getName().equals(Keyword.KW_length.toString())) { iterator.remove(); } } IPropertyInfo lengthProperty = GosuShop.createPropertyDelegate(JavaTypeInfo.this, GosuShop.createLengthProperty(JavaTypeInfo.this)); ret.add(lengthProperty); } }
private void addArrayProperties(List<IPropertyInfo> ret) { if ( getOwnersType().isArray()) { for (Iterator<IPropertyInfo> iterator = ret.iterator(); iterator.hasNext();) { IPropertyInfo propertyInfo = iterator.next(); if (propertyInfo.getName().equals(Keyword.KW_length.toString())) { iterator.remove(); } } IPropertyInfo lengthProperty = GosuShop.createPropertyDelegate(JavaTypeInfo.this, GosuShop.createLengthProperty(JavaTypeInfo.this)); ret.add(lengthProperty); } }
protected void mergeProperty(PropertyNameMap<T> props, IPropertyInfo propertyInfo, boolean replace) { boolean prependPrefix = _superPropertyPrefix != null && ! propertyInfo.getOwnersType().equals( _typeInfo.getOwnersType() ); T cs = convertCharSequenceToCorrectSensitivity( prependPrefix ? ( _superPropertyPrefix + propertyInfo.getName() ) : propertyInfo.getName() ); if ( replace || shouldReplace( props, cs, propertyInfo ) ) { if ( prependPrefix ) { props.put( cs, new PropertyInfoDelegate( propertyInfo.getContainer(), propertyInfo, cs.toString() ) ); } else { props.put(cs, propertyInfo); } } }
protected void mergeProperty(PropertyNameMap<T> props, IPropertyInfo propertyInfo, boolean replace) { boolean prependPrefix = _superPropertyPrefix != null && ! propertyInfo.getOwnersType().equals( _typeInfo.getOwnersType() ); T cs = convertCharSequenceToCorrectSensitivity( prependPrefix ? ( _superPropertyPrefix + propertyInfo.getName() ) : propertyInfo.getName() ); if (replace || !props.containsKey(cs)) { if ( prependPrefix ) { props.put( cs, new PropertyInfoDelegate( propertyInfo.getContainer(), propertyInfo, cs.toString() ) ); } else { props.put(cs, propertyInfo); } } }
private PropertyNameMap<T> convertToMap(List<IPropertyInfo> features) { PropertyNameMap<T> ret = new PropertyNameMap(); for (IPropertyInfo feature : features) { ret.put(convertCharSequenceToCorrectSensitivity(feature.getName()), feature); } ret.freeze(); return ret; }
private String buildHtmlForProperty( IJavaType type, IPropertyInfo propertyInfo ) { String propertyName = propertyInfo.getName(); String strClassName = type.getName(); strClassName = GosuStringUtil.replaceChars( strClassName, '.', '/' ); return buildHtml( getJavadocURLPrefix( type ) + strClassName + ".html#" + propertyName, propertyName ); }
private PropertyNameMap<T> convertToMap(List<IPropertyInfo> features) { PropertyNameMap<T> ret = new PropertyNameMap(); for (IPropertyInfo feature : features) { ret.put(convertCharSequenceToCorrectSensitivity(feature.getName()), feature); } ret.freeze(); return ret; }
private static void maybePushEnumTypes(ISymbolTable symbolTable, IType returnType) { if( !returnType.isEnum() ) { return; } for(IPropertyInfo pi : returnType.getTypeInfo().getProperties() ) { if( pi.isStatic() && pi.isPublic() ) { symbolTable.putSymbol( new Symbol(pi.getName(), pi.getFeatureType(), null) ); } } }
private static void maybePushEnumTypes(ISymbolTable symbolTable, IType returnType) { if( !returnType.isEnum() ) { return; } for(IPropertyInfo pi : returnType.getTypeInfo().getProperties() ) { if( pi.isStatic() && pi.isPublic() ) { symbolTable.putSymbol( new Symbol(pi.getName(), pi.getFeatureType(), null) ); } } }
private IRExpression autoCreateEntityValue(IPropertyInfo pi, IRSymbol rootSymbol) { return checkCast( _expr().getType(), callStaticMethod(MemberAccessTransformer.class, "autoCreateEntityInstance", new Class[]{Object.class, String.class, String.class}, exprList( identifier( rootSymbol ), pushConstant(pi.getOwnersType().getName()), pushConstant(pi.getName())) ) ); }
private IRExpression autoCreateEntityValue(IPropertyInfo pi, IRSymbol rootSymbol) { return checkCast( _expr().getType(), callStaticMethod(MemberAccessTransformer.class, "autoCreateEntityInstance", new Class[]{Object.class, String.class, String.class}, exprList( identifier( rootSymbol ), pushConstant(pi.getOwnersType().getName()), pushConstant(pi.getName())) ) ); }