com.bea.wli.config.customization
Class Customization

java.lang.Object
  extended by com.bea.wli.config.customization.Customization
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EnvValueCustomization, FindAndReplaceCustomization, ReferenceCustomization

public abstract class Customization
extends Object
implements Serializable

All Customizations must extend this class. This is a top level class for a customization, for e.g. env value find and replace/reference mapping

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
abstract  Customization clone(Set<Ref> filter)
          Returns a copy of this customization and optionally modifies its target references so that the customization only applies to a reference if it is subsumed by a reference in the filter.
static List<Customization> fromXML(InputStream is)
          parses given input stream that contains the serialized xml represention and returns list of customizations.
static Customization fromXML(org.apache.xmlbeans.XmlObject xml)
          Converts the given xml representation of a customization into the Customization object.
 String getDescription()
          Returns the user given description for this customization
abstract  Set<Ref> getTargets()
          Returns the references to resources, folders or projects which the customizations will be applied to.
abstract  org.apache.xmlbeans.XmlObject toXML()
          Returns an xml representation for this customization
static void toXML(List<Customization> customizations, OutputStream os)
          converts the give list of customization into an xml form and serializes to the given stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

getDescription

public String getDescription()
Returns the user given description for this customization

Returns:

getTargets

public abstract Set<Ref> getTargets()
Returns the references to resources, folders or projects which the customizations will be applied to.

Returns:

clone

public abstract Customization clone(Set<Ref> filter)
Returns a copy of this customization and optionally modifies its target references so that the customization only applies to a reference if it is subsumed by a reference in the filter. This operation essentially applies the customization to a smaller set of references. The target references is filtered so that one of the following happens:

  • if a target reference is in the filter then it is kept in the clone as well.
  • otherwise if a target reference is under a project/folder specified in the filter then it is kept in the clone.
  • otherwise, if there is a reference in the filter, that is under a target reference (for example filter contains folder a/b/c, and target contains project a) then the target reference (project a) is replaced with the filter reference (folder a/b/c), effectively narrowing the target reference to a more specific reference.
  • otherwise the target reference is removed.

    Parameters:
    filter - if filter is null no narrowing is performed, and the customization is cloned as-is.
    Returns:

  • toXML

    public abstract org.apache.xmlbeans.XmlObject toXML()
                                                 throws org.apache.xmlbeans.XmlException
    Returns an xml representation for this customization

    Returns:
    Throws:
    org.apache.xmlbeans.XmlException

    fromXML

    public static Customization fromXML(org.apache.xmlbeans.XmlObject xml)
    Converts the given xml representation of a customization into the Customization object.

    Parameters:
    xml -
    Returns:

    fromXML

    public static List<Customization> fromXML(InputStream is)
                                       throws IOException,
                                              org.apache.xmlbeans.XmlException
    parses given input stream that contains the serialized xml represention and returns list of customizations.

    Parameters:
    is - input stream that provides the xml document containing a list of customizations
    Returns:
    Throws:
    IOException
    org.apache.xmlbeans.XmlException

    toXML

    public static void toXML(List<Customization> customizations,
                             OutputStream os)
                      throws IOException,
                             org.apache.xmlbeans.XmlException
    converts the give list of customization into an xml form and serializes to the given stream.

    Parameters:
    customizations -
    os -
    Throws:
    IOException
    org.apache.xmlbeans.XmlException