Bis repetita placent :p

Typo:
public final class X implements Y {
 public static final Y CONSTANT= new X();

 private X() {
 }

 public static Y factory() {
  return CONSTANT;
 }
 ...
}

...static factory in that case


Quoting Jean-Philippe Clement <[email protected]>:

I will reply to myself... please tell me if there is a better way!

public final class X implements Y {
 public static final Y CONSTANT= new X();

 private X() {
 }

 public Y factory() {
  return CONSTANT;
 }
 ...
}

Then in the Blueprint:
<bean id="constant" class="X" factory-method="factory"/>

<bean class="Z">
 <argument ref="constant"/>
 ...
</bean>

Nice Blueprint stuff :)

Quoting Jean-Philippe Clement <[email protected]>:

Hello, I would like to use Java constants (static final) in Blueprint
configuration files.

Let's say I have the following Java:
public final class X implements Y {
public static final Y CONSTANT= new X();

private X() {
}
...
}

And:
public final class Z {
public Z(final Y y) {
...
}
...
}

How may I use this constant? Is this syntax correct...else?:
<bean class="Z">
<argument value="X.CONSTANT"/>
...
</bean>

Thanks!




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to