Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.sapia.util.xml.confix;

This interface is meant to be implemented by objects that are created by the Confix runtime, but are meant only for the sake of creating another object. This interface can also be implemented if a validation needs to be performed before actually returning the created object.

This allows objects that do not obey the Confix restrictions (adder and setter methods, no-args constructor, etc) to still be created with Confix. For example, the following code shows how a URL instance could be created:

 public class URLFactory implements ObjectCreationCallback{

   private _link;

   public void setLink(String link){
     _link = link;
    public object onCreate() throws ConfigurationException{
     if(_link == null){
       throw new ConfigurationException("URL 'link' attribute not specified");
        return new URL(_link);
     }catch(MalformedURLException e){
       throw new ConfigurationException("Invalid value for 'link' attribute in URL", e);

Yanick Duchesne
Copyright &.169; 2002-2003 Sapia Open Source Software. All Rights Reserved.
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
public interface ObjectCreationCallback {
Called by the Confix runtime when this instance has been created; allows it to return another object at its place. The method can also be used if validation needs to be performed before return this instance (or the object that this instance creates).

an Object
ConfigurationException if a problem occurs.
  public Object onCreate() throws ConfigurationException;
New to GrepCode? Check out our FAQ X