if ( propertyMetaData != null ) { try { return beanUtility.getProperty( name ); } catch ( BeanException e ) {
public void writeExpressionParameter( final XmlWriter writer, final BeanUtility beanUtility, final String propertyName, final String namespaceUri ) throws IOException, BeanException { // filter some of the standard properties. These are system-properties // and are set elsewhere final Object property = beanUtility.getProperty( propertyName ); final Class propertyType = beanUtility.getPropertyType( propertyName ); final String value = beanUtility.getPropertyAsString( propertyName ); if ( value != null && property != null ) { final AttributeList attList = new AttributeList(); attList.setAttribute( namespaceUri, "name", propertyName ); if ( BeanUtility.isSameType( propertyType, property.getClass() ) == false ) { attList.setAttribute( namespaceUri, "class", property.getClass().getName() ); } writer.writeTag( namespaceUri, "property", attList, XmlWriterSupport.OPEN ); writer.writeTextNormalized( value, false ); writer.writeCloseTag(); } }
String namespaceUri ) throws IOException, BeanException { final Object property = beanUtility.getProperty( propertyName ); if ( property == null ) { return;
private void validateProperty( final BeanUtility bu, final String name, final Object value, final Object nullValue ) throws BeanException { bu.setProperty( name, nullValue ); assertValue( nullValue, bu.getProperty( name ) ); bu.setProperty( name, value ); assertValue( value, bu.getProperty( name ) ); final String valString = bu.getPropertyAsString( name ); assertNotNull( valString ); bu.setProperty( name, nullValue ); assertValue( nullValue, bu.getProperty( name ) ); bu.setPropertyAsString( name, valString ); assertValue( value, bu.getProperty( name ) ); bu.setProperty( name, nullValue ); assertValue( nullValue, bu.getProperty( name ) ); }
private void writePreProcessor( final XmlWriter writer, final ReportPreProcessor preProcessor ) throws IntrospectionException, BeanException, IOException { if ( writer == null ) { throw new NullPointerException(); } if ( preProcessor == null ) { throw new NullPointerException(); } // the classic way, in case the expression does not provide any meta-data. This is // in the code for legacy reasons, as there are many expression implementations out there // that do not yet provide meta-data descriptions .. final BeanUtility beanUtility = new BeanUtility( preProcessor ); final String[] propertyNames = beanUtility.getProperties(); for ( int i = 0; i < propertyNames.length; i++ ) { final String key = propertyNames[i]; final Object property = beanUtility.getProperty( key ); final Class propertyType = beanUtility.getPropertyType( key ); final String value = beanUtility.getPropertyAsString( key ); if ( value != null && property != null ) { final AttributeList attList = new AttributeList(); attList.setAttribute( BundleNamespaces.LAYOUT, "name", key ); if ( BeanUtility.isSameType( propertyType, property.getClass() ) == false ) { attList.setAttribute( BundleNamespaces.LAYOUT, "class", property.getClass().getName() ); } writer.writeTag( BundleNamespaces.LAYOUT, "property", attList, XmlWriterSupport.OPEN ); writer.writeTextNormalized( value, false ); writer.writeCloseTag(); } } }
String namespaceUri ) throws IOException, BeanException { final Object property = beanUtility.getProperty( propertyName ); if (property == null) { return;
final Object attValue = beanUtility.getProperty( attributeMetaData.getName() ); if ( attValue == null ) { continue;
final Object property = beanUtility.getProperty( key ); final Class propertyType = beanUtility.getPropertyType( key ); final String value = beanUtility.getPropertyAsString( key );