Package com.bea.wli.config.customization
Class Customization
java.lang.Object
com.bea.wli.config.customization.Customization
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EnvValueCustomization
,FindAndReplaceCustomization
,ReferenceCustomization
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:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract Customization
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
(com.bea.wli.config.customizations.CustomizationsDocument customizationsDocument) Deprecated.static List<Customization>
fromXML
(InputStream is) Deprecated.useCustomization.fromXML(InputStream, SchemaTypeLoader)
insteadstatic List<Customization>
fromXML
(InputStream is, org.apache.xmlbeans.SchemaTypeLoader customTypeLoader) Parses given input stream that contains the serialized xml represention and returns list of customizations.static Customization
fromXML
(org.apache.xmlbeans.XmlObject xml) Deprecated.useCustomization.fromXML(InputStream, SchemaTypeLoader)
insteadReturns the user given description for this customizationReturns the references to resources, folders or projects which the customizations will be applied to.abstract com.bea.wli.config.customizations.CustomizationType
toXML()
Returns an xml representation for this customizationstatic com.bea.wli.config.customizations.CustomizationsDocument
toXML
(List<Customization> customizations) Converts the give list of customization into an xml form.static void
toXML
(List<Customization> customizations, OutputStream os) Converts the give list of customization into an xml form and serializes to the given stream.
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Method Details
-
getDescription
Returns the user given description for this customization- Returns:
- the user given description for this customization
-
getTargets
Returns the references to resources, folders or projects which the customizations will be applied to.- Returns:
- the references which the customizations will be applied to
-
clone
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:
- the copy of this customization
-
toXML
public abstract com.bea.wli.config.customizations.CustomizationType toXML() throws org.apache.xmlbeans.XmlExceptionReturns an xml representation for this customization- Returns:
- the xml document
- Throws:
org.apache.xmlbeans.XmlException
-
fromXML
@Deprecated public static Customization fromXML(org.apache.xmlbeans.XmlObject xml) throws com.bea.wli.config.customization.UnknownCustomizationTypeException, com.bea.wli.config.customization.CustomizationValidationException Deprecated.useCustomization.fromXML(InputStream, SchemaTypeLoader)
insteadConverts the given xml representation of a customization into the Customization object. NOTE: Values that use custom schema types (eg. transport-specific env values) will NOT have the correct schema types. To get the correct schema types, useCustomization.fromXML(InputStream, SchemaTypeLoader)
.- Parameters:
xml
- the xml representation of a customization- Returns:
- the Customization object
- Throws:
com.bea.wli.config.customization.UnknownCustomizationTypeException
- the xml is for an unsupported customization typecom.bea.wli.config.customization.CustomizationValidationException
- the XML document is invalid
-
fromXML
@Deprecated public static List<Customization> fromXML(InputStream is) throws IOException, org.apache.xmlbeans.XmlException, com.bea.wli.config.customization.UnknownCustomizationTypeException, com.bea.wli.config.customization.CustomizationValidationException Deprecated.useCustomization.fromXML(InputStream, SchemaTypeLoader)
insteadParses given input stream that contains the serialized xml represention and returns list of customizations. NOTE: Values that use custom schema types (eg. transport-specific env values) will NOT have the correct schema types. To get the correct schema types, useCustomization.fromXML(InputStream, SchemaTypeLoader)
.- Parameters:
is
- input stream that provides the xml document containing a list of customizations- Returns:
- the list of customizations
- Throws:
com.bea.wli.config.customization.UnknownCustomizationTypeException
- the xml is for an unsupported customization typecom.bea.wli.config.customization.CustomizationValidationException
- the XML document is invalidIOException
org.apache.xmlbeans.XmlException
-
fromXML
public static List<Customization> fromXML(InputStream is, org.apache.xmlbeans.SchemaTypeLoader customTypeLoader) throws IOException, org.apache.xmlbeans.XmlException, com.bea.wli.config.customization.UnknownCustomizationTypeException, com.bea.wli.config.customization.CustomizationValidationException 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 customizationscustomTypeLoader
- a schema type loader to use when parsing the input stream (for any custom schema types) (may be null)- Returns:
- the list of customizations
- Throws:
com.bea.wli.config.customization.UnknownCustomizationTypeException
- the xml is for an unsupported customization typecom.bea.wli.config.customization.CustomizationValidationException
- the XML document is invalidIOException
org.apache.xmlbeans.XmlException
-
fromXML
@Deprecated public static List<Customization> fromXML(com.bea.wli.config.customizations.CustomizationsDocument customizationsDocument) throws com.bea.wli.config.customization.UnknownCustomizationTypeException, com.bea.wli.config.customization.CustomizationValidationException Deprecated.useCustomization.fromXML(InputStream, SchemaTypeLoader)
insteadParses given xml document and returns list of customizations. NOTE: Values that use custom schema types (eg. transport-specific env values) will NOT have the correct schema types. To get the correct schema types, useCustomization.fromXML(InputStream, SchemaTypeLoader)
.- Parameters:
customizationsDocument
- the xml document containing a list of customizations- Returns:
- the list of customizations
- Throws:
com.bea.wli.config.customization.UnknownCustomizationTypeException
- the xml is for an unsupported customization typecom.bea.wli.config.customization.CustomizationValidationException
- the XML document is invalid
-
toXML
public static com.bea.wli.config.customizations.CustomizationsDocument toXML(List<Customization> customizations) throws org.apache.xmlbeans.XmlException Converts the give list of customization into an xml form.- Parameters:
customizations
- the list of customizations- Returns:
- the xml form
- Throws:
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
- the list customizationsos
- where to serialize the xml form- Throws:
IOException
org.apache.xmlbeans.XmlException
-
Customization.fromXML(InputStream, SchemaTypeLoader)
instead