properties

Java+Reflection: Invoke method on variable access. Is it possible?

Hi All, I was wondering if it is possible, using reflection, or something similar to invoke a method whenever a variable is accessed in read or write mode. In a nutshell my goal is similar to the behavior of C# properties. Example: Let's say I have a two classes A and B... public class A{ public int field; public void foo(){ ...

spring <util:properties /> with wildcards

I'd like to load key-value pairs from multiple locations. My first guess was: <util:properties id="requestProcessorRepository" location="classpath*:*requestProcessors.properties"/> but it is not valid Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [classpath*:*requestProcess...

Spring incremental configuration using PropertyPlaceholderConfigurer

I'm trying to find a way to re-use a spring configuration. The component I want to reuse is working like that: The component is assembled inside the Spring context using a 'configBuilder'. The config builder is a bean that parse a string retrieved from a PropertyPlaceholderConfigurer to create a Config bean. The resulting config bean is...

js error "_ci has no propeties" in firefox

I tried to implement a calender control into my web app. It works find in IE, but got error "_ci has no propeties" when running in firefox. document.writeln('<iframe name="__calendarIframe" id="__calendarIframe" width="100%" height="100%" scrolling="no" frameborder="0" style="margin:0px;"><\/iframe>'); var __ci = window.frames['__calen...

Wondering whether I should just bail on using properties in python

Hi, I have been trying to use properties instead of specific setters and getters in my app. They seem more pythonic and generally make my code more readable. More readable except for one issue: Typos. consider the following simple example (note, my properties actually do some processing even though the examples here just set or retu...

Groovy List all properties for class

I'm trying to list the properties (i.e. all properties that have a getter method) using Groovy. I can do this using myObj.properties.each { k,v -> println v} and that works fine. But, that also prints for the entire superclass hierarchy as well. If I just want to list the properties for the current class (and not the super class), is tha...

How can I save the values entered at design time for a complex property?

I'm still learning the ropes when it comes to implementing custom editors for complex properties at design time. As a simple starting point, I'm trying to enable design-time editing of a property of type ICollection<string>. What I've done so far is: Wrote a StringsEditor class, which derives from UITypeEditor and displays a drop-dow...

How should i handle public properties?

Within my application i have a PUBLIC customer class... Public Class Customer Public Name As String Public Surname As String End Class Then i decided to use LINQ to SQL within my application. After adding the MyDatabase.dbml class, errors showed up since LINQ creates public properties too <Column(Storage:="_Name", DbType:="NV...

What is the best practice when you have read-only properties and cannot use the objectdatasource?

I have started a web forms project using nHibernate and objectdatasources; however, I've learned that there are some limitations that I understand but do not know to handle. These limitations include 1) objectdatasources require parameterless constructors and 2) properties of the business object cannot be read-only. The problem I'm havi...

Objective-C property release error

Hi, what could be causing this crash? From everything I've read, I'm using the property correctly. When I call the method loadDot2Dot a first time, it works fine. Then when I go back to the main menu (call loadMainMenu) and try to load the dot2DotVC again (call loadDot2DotVC again), I get a crash (Exc_Bad_Access) - with no further info. ...

How to access *.properties file in Seam application.

Is there a way to access properties files in seam app? I'm looking for some kind of resource loader.. Thanks in advance! ...

initializer, properties, accessors and copy/retain/readonly

I want to understand how to set the parameters of properties (accessors). I took the following code from an example of Kal calendar. // Holiday.h @interface Holiday : NSObject { NSDate *date; NSString *name; NSString *country; } @property (nonatomic, retain, readonly) NSDate *date; @property (nonatomic, retain, readonly) NSStri...

User control not retaining property values

I have a very simple user control with 5 radio buttons on it, and 3 properties (ID, RatingSetID, and Rating). On the initial load of the page they are on, the code acquires data and places the data into the 3 properties. However, when the submit button is clicked the page reloads and the 3 properties get reset to 0, they are in the !IsPo...

@dynamic properties and its usage?

Can anyone give me clear picture about dynamic property and its usage? y not use the usual @property everywhere? ...

nHibernate - Iterate properties of a class to generically add parameters for stored procedure

I want to have a class that defines my parameter data for a stored procedure. It's going to be a very simple object: public class MyQueryData : SprocObjectBase { public int Value1 { get; set; } public string Value2 { get; set; } public bool Value3 { get; set; } ... } It will inherit from a base class with shared values, like...

JSP Access to Javabean Properties

I have a Java class with a method, hasMoreParameters(). In JSP, I want to get the property: ${holder.moreParameters} How do I do this? ...

How to prevent groovy from creating lowercase (meta) property names?

Hi folks, I've a problem. I want to have nice dynamic groovy classes to represent an ugly XML structure (unfortunately JAXB, XmlBeans etc. is not possible). For this goal I need case-sensitive properties to map the element values from XML to my classes. But Groovy generates automatically lowercase property names due to the JavaBeans sp...

How to load a properties file in J2EE app with Tomcat

I am debugging in Eclipse and Tomcat - and I want to load in a property from a file called foo.properties. The file is stored in src directory, like so: The following variable is always null: java.net.URL url = loader.getResource(propFile); which is becaue (I am guessing) the ClassLoader could locate the foo.properties file. The ...

Trashed properties in Application Delegate.

I'm in deep trouble. Something in my app causes a lot of properties in my app delegate to become trashed (changing contents and even object type, say an NSArray becomes an NSString...), and I can't debug it out. I can find no memory leaks or errors on my part. The only thing I've found is that all the way to ViewDidAppear for the view of...

Apache Ant v1.8.1: Error resolving loaded properties that include references to common properties

This worked in Ant 1.7.1 but no longer works in Ant 1.8.1. Is this a bug or is there a new and/or better way to achieve what I'm trying to do? The Project consists of 2 components, each component has it's own build file and properties file, there is also a top level build file and properties file for common ant targets and properties. I...