Java Sample : Music Store
| Schema Summary This sample shows how a to use the generated code to implement a simple request response (client/server) application. Schema Details The Request represents a search request for an album (like the interfaces exposed by Amazon or Play). The response represents the result of the search, in this case either a set of results or an error. If results are returned then this may contain 0-n products (a product being an album), each album has one or more tracks, and a track has a title and length. Sample Description The sample demonstrates how to Create a request document, get the underlying XML. Decode the request, and build a response. Then decode and display the response. In short both side of a very simple client server application. |
Sample XML File
<?xml version="1.0" encoding="UTF-8"?>
<SearchResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MusicStore.xsd">
<Result>
<SearchDate>2003-01-20</SearchDate>
<Product Label="Parlophone" ProductCode="0004U94562457MS" RRP="7.99">
<AlbumName>Parachutes</AlbumName>
<ArtistName>ColdPlay</ArtistName>
<Track>
<Title>Don't Panic</Title>
<Length>PT2M10S</Length>
</Track>
<Track>
<Title>Shiver</Title>
<Length>PT3M10S</Length>
</Track>
<Track>
<Title>Spies</Title>
<Length>PT2M12S</Length>
</Track>
<Track>
<Title>Sparks</Title>
<Length>PT3M40S</Length>
</Track>
<Track>
<Title>Yellow</Title>
<Length>PT6M12S</Length>
</Track>
<Track>
<Title>Trouble</Title>
<Length>PT3M12S</Length>
</Track>
<Track>
<Title>Parachutes</Title>
<Length>PT3M21S</Length>
</Track>
<Track>
<Title>High Speed</Title>
<Length>PT4M10S</Length>
</Track>
<Track>
<Title>We Never Change</Title>
<Length>PT4M36S</Length>
</Track>
<Track>
<Title>Everything's Not Lost</Title>
<Length>PT2M59S</Length>
</Track>
</Product>
<Product Label="Parlophone" ProductCode="1001542157321SW" RRP="8.59">
<AlbumName>X&Y</AlbumName>
<ArtistName>ColdPlay</ArtistName>
<Track>
<Title>Square One</Title>
<Length>PT2M10S</Length>
</Track>
<Track>
<Title>What If</Title>
<Length>PT3M01S</Length>
</Track>
<Track>
<Title>White Shadows</Title>
<Length>PT3M04S</Length>
</Track>
<Track>
<Title>Fix You</Title>
<Length>PT4M36S</Length>
</Track>
<Track>
<Title>Talk</Title>
<Length>PT5M42S</Length>
</Track>
<Track>
<Title>X&Y</Title>
<Length>PT2M12S</Length>
</Track>
<Track>
<Title>Speed Of Sound</Title>
<Length>PT3M58S</Length>
</Track>
<Track>
<Title>A Message</Title>
<Length>PT4M15S</Length>
</Track>
<Track>
<Title>Low</Title>
<Length>PT3M21S</Length>
</Track>
<Track>
<Title>The Hardest Part</Title>
<Length>PT4M24S</Length>
</Track>
<Track>
<Title>Swallowed In The Sea</Title>
<Length>PT2M35S</Length>
</Track>
<Track>
<Title>Twisted Logic</Title>
<Length>PT5M54S</Length>
</Track>
<Track>
<Title>Till Kingdom Come</Title>
<Length>PT10M15S</Length>
</Track>
</Product>
</Result>
</SearchResponse>
|
try
{
String strXmlRequest = createSearchRequest();
System.out.println(strXmlRequest);
String strXmlResponse = processSearchRequest(strXmlRequest);
displayResults(strXmlResponse);
System.out.println(strXmlRequest);
}
catch (Exception e)
{
// Note : exceptions are likely to contain inner exceptions
// that provide further detail about the error, GetFullMessage
// concatantes the messages from them all.
System.out.println(getFullExceptionMsg(e));
}
static String createSearchRequest() throws Exception
{
// create an instance of the class
MusicStoreLib.SearchRequest request = new MusicStoreLib.SearchRequest();
// setup our search criteria
request.setNameFilter("coldplay");
request.getPriceFilter().setMaxPrice(9.99);
// Return the Request XML
return request.toXml();
}
static String processSearchRequest(String requestXML) throws Exception
{
// create an instance of the class to load the XML file into
MusicStoreLib.SearchRequest request = new MusicStoreLib.SearchRequest();
// load the request
request.fromXml(requestXML);
// use the search criteria in a query
String strXmlResponse =
getSearchResults(
request.getNameFilter(),
(request.getPriceFilter().isValidMinPrice()?request.getPriceFilter().getMinPrice():0),
(request.getPriceFilter().isValidMaxPrice()?request.getPriceFilter().getMaxPrice():1e100));
return strXmlResponse;
}
static String getSearchResults(
String nameFilter,
double minValueFilter,
double maxValueFilter) throws Exception
{
// setup Database query (use your imagination!)
String strSQLAlbum =
"SELECT * " \
"FROM Album " \
"WHERE ArtistName = @ArtistFilter AND " \
" Price > @MinPriceFilter AND " \
" Price < @MaxPriceFilter AND ";
String strSQLTrack =
"SELECT * " \
"FROM Track " \
"WHERE AlbumID = @AlbumID";
database.Connection conn;
database.Recordset rsTrack;
database.Recordset rsAlbum;
database.Command cmdTrack;
database.Command cmdAlbum;
conn = new database.Connection();
cmdAlbum = new database.Recordset();
cmdTrack = new database.Command();
conn.open("...");
cmdAlbum.setActiveConnection(conn);
cmdAlbum.getParameters().append(cmdAlbum.createParameter(nameFilter));
cmdAlbum.getParameters().append(cmdAlbum.createParameter(minValueFilter));
cmdAlbum.getParameters().append(cmdAlbum.createParameter(maxValueFilter));
cmdTrack.setActiveConnection(conn);
cmdTrack.getParameters().append(cmdTrack.createParameter(0));
// query the database
rsAlbum = cmdAlbum.execute();
// create an instance of the class to load the XML file into
MusicStoreLib.SearchResponse response = new MusicStoreLib.SearchResponse();
MusicStoreLib.AlbumType album;
MusicStoreLib.TrackType track;
response.getResult().setSearchDate(LtXmlLib21.DateTime::GetCurrentTime());
while (spRsAlbum.adoEOF == false)
{
// Add a new album to the collection
album = response.getResult().getProduct().add();
// populate the album
album.setAlbumName (rsAlbum.getFields().get("AlbumName").getValue());
album.setArtistName (rsAlbum.getFields().get("ArtistName").getValue()));
album.setLabel (rsAlbum.getFields().get("RecordLabel").getValue()));
album.setProductCode (rsAlbum.getFields().get("ProductCode").getValue()));
if (spRsAlbum.getFields().get("Price").getValue() == null)
album.setRRP (spRsAlbum.getFields().get("Price").getValue());
// Query the DB for all the tracks in the album
cmdTrack.getParameters().get(1).setValue(spRsAlbum.getFields().get("AlbumID").getValue());
rsTrack = cmdTrack.execute();
// add all the tracks
while (rsTrack.getEOF() == false)
{
// create a track in the XML
track = album.getTrack().add();
// populate the track
track.setTitle(rsTrack.getFields().get("Title").getValue());
track.getLength().setSeconds(rsTrack.getFields().get("Duration").getValue());
rsTrack.moveNext();
}
spRsAlbum.moveNext();
}
// always call Close when done reading.
conn.close();
// return the XML
return response.toXml();
}
// Shows a simple example of how the class SearchRequest
// can be used. This class can be used to load documents whose
// root (document) element is <SearchRequest>.
static void DisplayResults(String xmlResponse) throws Exception
{
// create an instance of the class to load the XML file into
MusicStoreLib.SearchResponse response = new MusicStoreLib.SearchResponse();
// load the xml from a file into the object (the root element in the
// xml document must be <SearchResponse>.
response.fromXml(xmlResponse);
if (response.getChoiceSelectedElement().equals("Result"))
{
System.out.println("Query Was Executes " + response.getResult().getSearchDate().toString());
for (int i=0; i < response.getResult().getProduct().size(); i++)
{
// ouput each album that was found
MusicStoreLib.AlbumType album = response.getResult().getProduct().get(i);
System.out.println("Artist Name : " + album.getArtistName() );
System.out.println("Album Title : " + album.getAlbumName() );
System.out.println("Product Code : " + album.getProductCode() );
System.out.println("Record Label : " + album.getLabel() );
if (album.isValidRRP())
System.out.println("Price : " + album.getRRP());
// output the tracks
for (int iTrk=0; iTrk < album.getTrack().size(); iTrk++)
{
MusicStoreLib.TrackType track = album.getTrack().get(iTrk);
System.out.println( " Track Name: " + track.getTitle() +
" (" + track.getLength().getMinutes() + ", " +
track.getLength().getSeconds() + ")");
}
}
}
else if (response.getChoiceSelectedElement().equals("Error"))
{
System.out.println("An Error Occured");
System.out.println("Error Code : " + response.getError().getErrorCode());
System.out.println("Descritpion : " + response.getError().getErrorDescription());
if (response.getError().isValidHelpFile())
System.out.println("Help File : " + response.getError().getHelpFile());
}
else
{
// error - should always have a result or an error
}
}
|
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="SearchRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="PriceFilter">
<xs:complexType>
<xs:sequence>
<xs:element name="MinPrice" type="xs:double" minOccurs="0"/>
<xs:element name="MaxPrice" type="xs:double" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NameFilter" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SearchResponse">
<xs:complexType>
<xs:choice>
<xs:element name="Result">
<xs:complexType>
<xs:sequence>
<xs:element name="SearchDate" type="xs:date"/>
<xs:element name="Product" type="AlbumType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Error">
<xs:complexType>
<xs:sequence>
<xs:element name="ErrorCode" type="xs:int"/>
<xs:element name="ErrorDescription" type="xs:string"/>
<xs:element name="HelpFile" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:complexType name="AlbumType">
<xs:sequence>
<xs:element name="AlbumName" type="xs:string"/>
<xs:element name="ArtistName" type="xs:string"/>
<xs:element name="Track" type="TrackType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Label" type="xs:string" use="required"/>
<xs:attribute name="RRP" type="xs:double"/>
<xs:attribute name="ProductCode" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="15"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CompactDiskType">
<xs:sequence>
<xs:element name="Title" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TrackType">
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Length" type="xs:duration"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
|
![]() |
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the ComplexType AlbumType
// </summary>
public class AlbumType extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for AlbumType
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public AlbumType() {
setElementName("AlbumType");
init();
}
public AlbumType(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_label = "";
_rRP = 0;
_isValidRRP = false;
_productCode = "";
_albumName = "";
_artistName = "";
_track = new MusicStoreLib.XmlObjectCollection<MusicStoreLib.TrackType>("Track", "", 1, -1, false, MusicStoreLib.TrackType.class);
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.AlbumType newObject = (MusicStoreLib.AlbumType)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
newObject._label = _label;
if (_isValidRRP)
newObject._rRP = _rRP;
newObject._isValidRRP = _isValidRRP;
newObject._productCode = _productCode;
newObject._albumName = _albumName;
newObject._artistName = _artistName;
for(int i=0; i<_track.size(); i++)
newObject._track.add((MusicStoreLib.TrackType)_track.get(i).clone());
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents a mandatory Attribute in the XML document
// </summary>
// <remarks>
// This property is represented as an Attribute in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getLabel() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _label;
}
public void setLabel(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_label = value;
}
protected java.lang.String _label;
// <summary>
// Represents an optional Attribute in the XML document
// </summary>
// <remarks>
// This property is represented as an Attribute in the XML.
// It is optional, initially it is not valid.
// </remarks>
public double getRRP() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (_isValidRRP == false)
throw new com.liquid_technologies.ltxmllib21.exceptions.LtInvalidStateException("The Property RRP is not valid. Set RRPValid = true");
return _rRP;
}
public void setRRP(double value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
_isValidRRP = true;
_rRP = value;
}
// <summary>
// Indicates if RRP contains a valid value.
// </summary>
// <remarks>
// true if the value for RRP is valid, false if not.
// If this is set to true then the property is considered valid, and assigned its
// default value (0).
// If its set to false then its made invalid, and subsequent calls to get RRP
// will raise an exception.
// </remarks>
public boolean isValidRRP() {
return _isValidRRP;
}
public void setValidRRP(boolean value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (value != _isValidRRP) {
_rRP = 0;
_isValidRRP = value;
}
}
protected boolean _isValidRRP;
protected double _rRP;
// <summary>
// Represents a mandatory Attribute in the XML document
// </summary>
// <remarks>
// This property is represented as an Attribute in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getProductCode() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _productCode;
}
public void setProductCode(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
((com.liquid_technologies.ltxmllib21.AttributeInfoPrimitive)__attributeInfo[2]).checkRestriction(value);
_productCode = value;
}
protected java.lang.String _productCode;
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getAlbumName() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _albumName;
}
public void setAlbumName(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_albumName = value;
}
protected java.lang.String _albumName;
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getArtistName() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _artistName;
}
public void setArtistName(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_artistName = value;
}
protected java.lang.String _artistName;
// <summary>
// A collection of Tracks
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// This collection may contain 1 to Many objects.
// </remarks>
public MusicStoreLib.XmlObjectCollection<MusicStoreLib.TrackType> getTrack() {
return _track;
}
protected MusicStoreLib.XmlObjectCollection<MusicStoreLib.TrackType> _track;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.SEQUENCE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "AlbumType", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("AlbumName", "", findGetterMethod("MusicStoreLib.AlbumType", "getAlbumName"), findSetterMethod("MusicStoreLib.AlbumType", "setAlbumName", "java.lang.String"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("ArtistName", "", findGetterMethod("MusicStoreLib.AlbumType", "getArtistName"), findSetterMethod("MusicStoreLib.AlbumType", "setArtistName", "java.lang.String"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqClsCol("Track", "", findGetterMethod("MusicStoreLib.AlbumType", "getTrack"), com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
new com.liquid_technologies.ltxmllib21.AttributeInfoPrimitive("Label", "", findGetterMethod("MusicStoreLib.AlbumType", "getLabel"), findSetterMethod("MusicStoreLib.AlbumType", "setLabel", "java.lang.String"), com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.AttributeInfoPrimitive("RRP", "", findGetterMethod("MusicStoreLib.AlbumType", "getRRP"), findSetterMethod("MusicStoreLib.AlbumType", "setRRP", "double"), findGetterMethod("MusicStoreLib.AlbumType", "isValidRRP"), com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_R8, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.COLLAPSE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.AttributeInfoPrimitive("ProductCode", "", findGetterMethod("MusicStoreLib.AlbumType", "getProductCode"), findSetterMethod("MusicStoreLib.AlbumType", "setProductCode", "java.lang.String"), com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", 15, -1, -1), null)
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
public final class ClassFactory {
private static java.util.Map<String, java.util.Map<String, Class<? extends com.liquid_technologies.ltxmllib21.XmlObjectBase>>> _nsMap = null;
static {
_nsMap = new java.util.HashMap<String, java.util.Map<String, Class<? extends com.liquid_technologies.ltxmllib21.XmlObjectBase>>>();
java.util.Map<String, Class<? extends com.liquid_technologies.ltxmllib21.XmlObjectBase>> itemMap = null;
itemMap = new java.util.HashMap<String, Class<? extends com.liquid_technologies.ltxmllib21.XmlObjectBase>>();
itemMap.put("AlbumType", MusicStoreLib.AlbumType.class);
itemMap.put("Error", MusicStoreLib.Error.class);
itemMap.put("PriceFilter", MusicStoreLib.PriceFilter.class);
itemMap.put("Result", MusicStoreLib.Result.class);
itemMap.put("SearchRequest", MusicStoreLib.SearchRequest.class);
itemMap.put("SearchResponse", MusicStoreLib.SearchResponse.class);
itemMap.put("TrackType", MusicStoreLib.TrackType.class);
_nsMap.put("", itemMap);
}
/**
* Creates an object from XML data held in a string.
*
* @param xmlIn The data to be loaded
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXml(String xmlIn)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
return fromXml( xmlIn, com.liquid_technologies.ltxmllib21.SerializationContext.Default );
}
/**
* Creates an object from XML data held in a string.
*
* @param xmlIn The data to be loaded
* @param context The context to use when loading the data
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXml(String xmlIn, com.liquid_technologies.ltxmllib21.SerializationContext context)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
com.liquid_technologies.ltxmllib21.dom.XmlDocument parser = new com.liquid_technologies.ltxmllib21.dom.XmlDocument();
parser.parse(new java.io.ByteArrayInputStream(xmlIn.getBytes()), context);
return fromXmlElement(parser.getDocumentElement(), context);
}
/**
* Creates an object from XML data held in a File
*
* @param FileName The file to be loaded
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXmlFile(String FileName)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
return fromXmlFile(FileName, com.liquid_technologies.ltxmllib21.SerializationContext.Default);
}
/**
* Creates an object from XML data held in a File
*
* @param FileName The file to be loaded
* @param context The context to use when loading the data
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXmlFile(String FileName, com.liquid_technologies.ltxmllib21.SerializationContext context)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
com.liquid_technologies.ltxmllib21.dom.XmlDocument parser = new com.liquid_technologies.ltxmllib21.dom.XmlDocument();
parser.parse(FileName, context);
return fromXmlElement(parser.getDocumentElement(), context);
}
/**
* Creates an object from XML data held in a stream.
*
* @param stream The data to be loaded
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXmlStream(byte[] data)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
return fromXmlStream(data, com.liquid_technologies.ltxmllib21.SerializationContext.Default);
}
/**
* Creates an object from XML data held in a stream.
*
* @param stream The data to be loaded
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXmlStream(byte[] data, com.liquid_technologies.ltxmllib21.SerializationContext context)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
com.liquid_technologies.ltxmllib21.dom.XmlDocument parser = new com.liquid_technologies.ltxmllib21.dom.XmlDocument();
java.io.ByteArrayInputStream baStream = new java.io.ByteArrayInputStream(data);
parser.parse(baStream, context);
return fromXmlElement(parser.getDocumentElement(), context);
}
/**
* Creates an object from an XML Element.
*
* @param xmlParent The data that needs loading
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXmlElement(com.liquid_technologies.ltxmllib21.dom.XmlElement xmlParent)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
return fromXmlElement(xmlParent, com.liquid_technologies.ltxmllib21.SerializationContext.Default);
}
/**
* Creates an object from an XML Element.
*
* @param xmlParent The data that needs loading
* @param context The context to use when loading the data
* @return The wrapper object, loaded with the supplied data
* @throws LtException Throws an exception if the XML data is not compatible with the schema</remarks>
* @throws IOException
*/
public static com.liquid_technologies.ltxmllib21.XmlObjectBase fromXmlElement(com.liquid_technologies.ltxmllib21.dom.XmlElement xmlParent, com.liquid_technologies.ltxmllib21.SerializationContext context)
throws com.liquid_technologies.ltxmllib21.exceptions.LtException, java.io.IOException {
com.liquid_technologies.ltxmllib21.XmlObjectBase retVal = null;
String elementName;
String elementNamespaceUri;
// Get the type name this is either
// from the element i.e. <Parent>... = Parent
// or from the type i.e. <Parent xsi:type="someNS:SomeElement">... = SomeElement
elementName = com.liquid_technologies.ltxmllib21.ClassFactoryHelper.getElementType(xmlParent);
if (elementName.length() == 0) {
elementName = xmlParent.getLocalName();
elementNamespaceUri = xmlParent.getNamespaceURI();
} else {
elementNamespaceUri = com.liquid_technologies.ltxmllib21.ClassFactoryHelper.getElementTypeNamespaceUri(xmlParent);
}
// create the appropriate object
retVal = com.liquid_technologies.ltxmllib21.ClassFactoryHelper.createObject(_nsMap, elementName, elementNamespaceUri, context);
if (retVal == null) {
throw new com.liquid_technologies.ltxmllib21.exceptions.LtException("Failed load the element " + elementName + ":" + elementNamespaceUri + ". No appropriate class exists to load the data into. Ensure that the XML document complies with the schema.");
}
// load the data into the object
retVal.fromXmlElement(xmlParent, context);
return retVal;
}
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the ComplexType Error
// </summary>
public class Error extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for Error
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public Error() {
setElementName("Error");
init();
}
public Error(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_errorCode = 0;
_errorDescription = "";
_helpFile = "";
_isValidHelpFile = false;
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.Error newObject = (MusicStoreLib.Error)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
newObject._errorCode = _errorCode;
newObject._errorDescription = _errorDescription;
if (_isValidHelpFile)
newObject._helpFile = _helpFile;
newObject._isValidHelpFile = _isValidHelpFile;
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to 0.
// </remarks>
public int getErrorCode() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _errorCode;
}
public void setErrorCode(int value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
_errorCode = value;
}
protected int _errorCode;
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getErrorDescription() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _errorDescription;
}
public void setErrorDescription(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_errorDescription = value;
}
protected java.lang.String _errorDescription;
// <summary>
// Represents an optional Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is optional, initially it is not valid.
// </remarks>
public java.lang.String getHelpFile() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (_isValidHelpFile == false)
throw new com.liquid_technologies.ltxmllib21.exceptions.LtInvalidStateException("The Property HelpFile is not valid. Set HelpFileValid = true");
return _helpFile;
}
public void setHelpFile(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_isValidHelpFile = true;
_helpFile = value;
}
// <summary>
// Indicates if HelpFile contains a valid value.
// </summary>
// <remarks>
// true if the value for HelpFile is valid, false if not.
// If this is set to true then the property is considered valid, and assigned its
// default value ("").
// If its set to false then its made invalid, and subsequent calls to get HelpFile
// will raise an exception.
// </remarks>
public boolean isValidHelpFile() {
return _isValidHelpFile;
}
public void setValidHelpFile(boolean value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (value != _isValidHelpFile) {
_helpFile = "";
_isValidHelpFile = value;
}
}
protected boolean _isValidHelpFile;
protected java.lang.String _helpFile;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.SEQUENCE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "Error", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("ErrorCode", "", findGetterMethod("MusicStoreLib.Error", "getErrorCode"), findSetterMethod("MusicStoreLib.Error", "setErrorCode", "int"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_I4, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.COLLAPSE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("ErrorDescription", "", findGetterMethod("MusicStoreLib.Error", "getErrorDescription"), findSetterMethod("MusicStoreLib.Error", "setErrorDescription", "java.lang.String"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimOpt("HelpFile", "", findGetterMethod("MusicStoreLib.Error", "getHelpFile"), findSetterMethod("MusicStoreLib.Error", "setHelpFile", "java.lang.String"), findGetterMethod("MusicStoreLib.Error", "isValidHelpFile"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the ComplexType PriceFilter
// </summary>
public class PriceFilter extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for PriceFilter
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public PriceFilter() {
setElementName("PriceFilter");
init();
}
public PriceFilter(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_minPrice = 0;
_isValidMinPrice = false;
_maxPrice = 0;
_isValidMaxPrice = false;
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.PriceFilter newObject = (MusicStoreLib.PriceFilter)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
if (_isValidMinPrice)
newObject._minPrice = _minPrice;
newObject._isValidMinPrice = _isValidMinPrice;
if (_isValidMaxPrice)
newObject._maxPrice = _maxPrice;
newObject._isValidMaxPrice = _isValidMaxPrice;
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents an optional Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is optional, initially it is not valid.
// </remarks>
public double getMinPrice() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (_isValidMinPrice == false)
throw new com.liquid_technologies.ltxmllib21.exceptions.LtInvalidStateException("The Property MinPrice is not valid. Set MinPriceValid = true");
return _minPrice;
}
public void setMinPrice(double value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
_isValidMinPrice = true;
_minPrice = value;
}
// <summary>
// Indicates if MinPrice contains a valid value.
// </summary>
// <remarks>
// true if the value for MinPrice is valid, false if not.
// If this is set to true then the property is considered valid, and assigned its
// default value (0).
// If its set to false then its made invalid, and subsequent calls to get MinPrice
// will raise an exception.
// </remarks>
public boolean isValidMinPrice() {
return _isValidMinPrice;
}
public void setValidMinPrice(boolean value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (value != _isValidMinPrice) {
_minPrice = 0;
_isValidMinPrice = value;
}
}
protected boolean _isValidMinPrice;
protected double _minPrice;
// <summary>
// Represents an optional Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is optional, initially it is not valid.
// </remarks>
public double getMaxPrice() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (_isValidMaxPrice == false)
throw new com.liquid_technologies.ltxmllib21.exceptions.LtInvalidStateException("The Property MaxPrice is not valid. Set MaxPriceValid = true");
return _maxPrice;
}
public void setMaxPrice(double value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
_isValidMaxPrice = true;
_maxPrice = value;
}
// <summary>
// Indicates if MaxPrice contains a valid value.
// </summary>
// <remarks>
// true if the value for MaxPrice is valid, false if not.
// If this is set to true then the property is considered valid, and assigned its
// default value (0).
// If its set to false then its made invalid, and subsequent calls to get MaxPrice
// will raise an exception.
// </remarks>
public boolean isValidMaxPrice() {
return _isValidMaxPrice;
}
public void setValidMaxPrice(boolean value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
if (value != _isValidMaxPrice) {
_maxPrice = 0;
_isValidMaxPrice = value;
}
}
protected boolean _isValidMaxPrice;
protected double _maxPrice;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.SEQUENCE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "PriceFilter", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimOpt("MinPrice", "", findGetterMethod("MusicStoreLib.PriceFilter", "getMinPrice"), findSetterMethod("MusicStoreLib.PriceFilter", "setMinPrice", "double"), findGetterMethod("MusicStoreLib.PriceFilter", "isValidMinPrice"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_R8, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.COLLAPSE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimOpt("MaxPrice", "", findGetterMethod("MusicStoreLib.PriceFilter", "getMaxPrice"), findSetterMethod("MusicStoreLib.PriceFilter", "setMaxPrice", "double"), findGetterMethod("MusicStoreLib.PriceFilter", "isValidMaxPrice"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_R8, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.COLLAPSE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the ComplexType Result
// </summary>
public class Result extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for Result
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public Result() {
setElementName("Result");
init();
}
public Result(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_searchDate = new com.liquid_technologies.ltxmllib21.DateTime(com.liquid_technologies.ltxmllib21.DateTimeType.date);
_product = new MusicStoreLib.XmlObjectCollection<MusicStoreLib.AlbumType>("Product", "", 0, -1, false, MusicStoreLib.AlbumType.class);
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.Result newObject = (MusicStoreLib.Result)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
newObject._searchDate = (com.liquid_technologies.ltxmllib21.DateTime)_searchDate.clone();
for(int i=0; i<_product.size(); i++)
newObject._product.add((MusicStoreLib.AlbumType)_product.get(i).clone());
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to new com.liquid_technologies.ltxmllib21.DateTime(com.liquid_technologies.ltxmllib21.DateTimeType.date).
// </remarks>
public com.liquid_technologies.ltxmllib21.DateTime getSearchDate() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _searchDate;
}
public void setSearchDate(com.liquid_technologies.ltxmllib21.DateTime value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
_searchDate.setDateTime(value, _searchDate.getType());
}
protected com.liquid_technologies.ltxmllib21.DateTime _searchDate;
// <summary>
// A collection of Products
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// This collection may contain 0 to Many objects.
// </remarks>
public MusicStoreLib.XmlObjectCollection<MusicStoreLib.AlbumType> getProduct() {
return _product;
}
protected MusicStoreLib.XmlObjectCollection<MusicStoreLib.AlbumType> _product;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.SEQUENCE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "Result", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("SearchDate", "", findGetterMethod("MusicStoreLib.Result", "getSearchDate"), findSetterMethod("MusicStoreLib.Result", "setSearchDate", "com.liquid_technologies.ltxmllib21.DateTime"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_DATE, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.COLLAPSE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqClsCol("Product", "", findGetterMethod("MusicStoreLib.Result", "getProduct"), com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the Element SearchRequest
// </summary>
public class SearchRequest extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for SearchRequest
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public SearchRequest() {
setElementName("SearchRequest");
init();
}
public SearchRequest(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_priceFilter = new MusicStoreLib.PriceFilter("PriceFilter");
_nameFilter = "";
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.SearchRequest newObject = (MusicStoreLib.SearchRequest)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
newObject._priceFilter = null;
if (_priceFilter != null)
newObject._priceFilter = (MusicStoreLib.PriceFilter)_priceFilter.clone();
newObject._nameFilter = _nameFilter;
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// If this property is set, then the object will be COPIED. If the property is set to null an exception is raised.
// </remarks>
public MusicStoreLib.PriceFilter getPriceFilter() {
return _priceFilter;
}
public void setPriceFilter(MusicStoreLib.PriceFilter value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
throw_IfPropertyIsNull(value, "PriceFilter");
if (value != null)
setElementName(value.getBase(), "PriceFilter");
// throw_IfElementNameDiffers(value, "PriceFilter");
_priceFilter = value;
}
protected MusicStoreLib.PriceFilter _priceFilter;
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getNameFilter() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _nameFilter;
}
public void setNameFilter(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_nameFilter = value;
}
protected java.lang.String _nameFilter;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.SEQUENCE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "SearchRequest", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqClsMnd("PriceFilter", "", findGetterMethod("MusicStoreLib.SearchRequest", "getPriceFilter"), findSetterMethod("MusicStoreLib.SearchRequest", "setPriceFilter", "MusicStoreLib.PriceFilter"), com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, MusicStoreLib.PriceFilter.class, false)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("NameFilter", "", findGetterMethod("MusicStoreLib.SearchRequest", "getNameFilter"), findSetterMethod("MusicStoreLib.SearchRequest", "setNameFilter", "java.lang.String"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the Element SearchResponse
// </summary>
public class SearchResponse extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for SearchResponse
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public SearchResponse() {
setElementName("SearchResponse");
init();
}
public SearchResponse(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_result = null;
_error = null;
_validElement = "";
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
protected void ClearChoice(String selectedElement) {
try {
_result = null;
_error = null;
_validElement = selectedElement;
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.SearchResponse newObject = (MusicStoreLib.SearchResponse)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
newObject._result = null;
if (_result != null)
newObject._result = (MusicStoreLib.Result)_result.clone();
newObject._error = null;
if (_error != null)
newObject._error = (MusicStoreLib.Error)_error.clone();
newObject._validElement = _validElement;
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents an optional Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is optional, initially it is null.
// Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to null will allow another element to be selected
// </remarks>
public MusicStoreLib.Result getResult() {
return _result;
}
public void setResult(MusicStoreLib.Result value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// The class represents a choice, so prevent more than one element from being selected
ClearChoice((value == null)?"":"Result"); // remove selection
if (value == null)
_result = null;
else {
setElementName(value.getBase(), "Result");
_result = value;
}
}
protected MusicStoreLib.Result _result;
// <summary>
// Represents an optional Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is optional, initially it is null.
// Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to null will allow another element to be selected
// </remarks>
public MusicStoreLib.Error getError() {
return _error;
}
public void setError(MusicStoreLib.Error value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// The class represents a choice, so prevent more than one element from being selected
ClearChoice((value == null)?"":"Error"); // remove selection
if (value == null)
_error = null;
else {
setElementName(value.getBase(), "Error");
_error = value;
}
}
protected MusicStoreLib.Error _error;
public String getChoiceSelectedElement() {
return _validElement;
}
protected String _validElement;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.CHOICE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "SearchResponse", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoChoiceClsOpt("Result", "", findGetterMethod("MusicStoreLib.SearchResponse", "getResult"), findSetterMethod("MusicStoreLib.SearchResponse", "setResult", "MusicStoreLib.Result"), com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, MusicStoreLib.Result.class)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoChoiceClsOpt("Error", "", findGetterMethod("MusicStoreLib.SearchResponse", "getError"), findSetterMethod("MusicStoreLib.SearchResponse", "setError", "MusicStoreLib.Error"), com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, MusicStoreLib.Error.class)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
package MusicStoreLib;
/**********************************************************************************************
* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
* See www.liquid-technologies.com for product details.
*
* Please see products End User License Agreement for distribution permissions.
*
* WARNING: THIS FILE IS GENERATED
* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
*
* Generation : by Liquid XML Data Binder 19.0.14.11049
* Using Schema: MusicStore.xsd
**********************************************************************************************/
// <summary>
// This class represents the ComplexType TrackType
// </summary>
public class TrackType extends com.liquid_technologies.ltxmllib21.XmlGeneratedClass {
private static final long serialVersionUID = 13L;
// <summary>
// Constructor for TrackType
// </summary>
// <remarks>
// The class is created with all the mandatory fields populated with the
// default data.
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd
// </remarks>
public TrackType() {
setElementName("TrackType");
init();
}
public TrackType(String elementName) {
setElementName(elementName);
init();
}
// <summary>
// Initializes the class
// </summary>
// <remarks>
// This creates all the mandatory fields (populated with the default data)
// All Collection object are created.
// However any 1-n relationships (these are represented as collections) are
// empty. To comply with the schema these must be populated before the xml
// obtained from ToXml is valid against the schema MusicStore.xsd.
// </remarks>
@Override
protected void init() {
try {
MusicStoreLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
_title = "";
_length = new com.liquid_technologies.ltxmllib21.Duration();
// ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional initialization code here...
// ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
getClassAttributeInfo();
getClassElementInfo();
} catch (Exception ex) {
// should never happen
ex.printStackTrace();
throw new InternalError();
}
}
// <summary>
// Allows the class to be copied
// </summary>
// <remarks>
// Performs a 'deep copy' of all the data in the class (and its children)
// </remarks>
@Override
public Object clone() throws CloneNotSupportedException {
try {
MusicStoreLib.TrackType newObject = (MusicStoreLib.TrackType)super.clone();
// clone, creates a bitwise copy of the class, so all the collections are the
// same as the parents. Init will re-create our own collections, and classes,
// preventing objects being shared between the new an original objects
newObject.init();
newObject._title = _title;
newObject._length = (com.liquid_technologies.ltxmllib21.Duration)_length.clone();
// ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional clone code here...
// ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
return newObject;
} catch (CloneNotSupportedException e) {
// should never happen
e.printStackTrace();
throw new InternalError();
}
}
@Override
public String getTargetNamespace() {
return "";
}
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to "".
// </remarks>
public java.lang.String getTitle() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _title;
}
public void setTitle(java.lang.String value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
// Apply whitespace rules appropriately
value = com.liquid_technologies.ltxmllib21.WhitespaceUtils.preserve(value);
_title = value;
}
protected java.lang.String _title;
// <summary>
// Represents a mandatory Element in the XML document
// </summary>
// <remarks>
// This property is represented as an Element in the XML.
// It is mandatory and therefore must be populated within the XML.
// It is defaulted to new com.liquid_technologies.ltxmllib21.Duration().
// </remarks>
public com.liquid_technologies.ltxmllib21.Duration getLength() throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
return _length;
}
public void setLength(com.liquid_technologies.ltxmllib21.Duration value) throws com.liquid_technologies.ltxmllib21.exceptions.LtException {
_length = value;
}
protected com.liquid_technologies.ltxmllib21.Duration _length;
@Override
public String getNamespace() {
return "";
}
@Override
public com.liquid_technologies.ltxmllib21.XmlObjectBase getBase() {
return this;
}
protected void onEvent(com.liquid_technologies.ltxmllib21.XmlObjectBase msgSource, int msgType, Object data) {
if (msgType == CollectionChangeEvent) {
}
}
private static com.liquid_technologies.ltxmllib21.ParentElementInfo __parentElementInfo = null;
private static com.liquid_technologies.ltxmllib21.ElementInfo[] __elementInfo = null;
private static com.liquid_technologies.ltxmllib21.AttributeInfo[] __attributeInfo = null;
protected com.liquid_technologies.ltxmllib21.ParentElementInfo getClassInfo() throws Exception {
if (__parentElementInfo == null) {
__parentElementInfo = new com.liquid_technologies.ltxmllib21.ParentElementInfo(
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementGroupType.SEQUENCE,
com.liquid_technologies.ltxmllib21.XmlObjectBase.XmlElementType.ELEMENT, "TrackType", "", true, false,
null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_NONE, com.liquid_technologies.ltxmllib21.WhitespaceRule.NONE, null, false);
}
return __parentElementInfo;
}
protected com.liquid_technologies.ltxmllib21.ElementInfo[] getClassElementInfo() throws Exception {
if (__elementInfo == null) {
__elementInfo = new com.liquid_technologies.ltxmllib21.ElementInfo[] {
new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("Title", "", findGetterMethod("MusicStoreLib.TrackType", "getTitle"), findSetterMethod("MusicStoreLib.TrackType", "setTitle", "java.lang.String"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_STRING, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.PRESERVE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
,new com.liquid_technologies.ltxmllib21.data.ElementInfoSeqPrimMnd("Length", "", findGetterMethod("MusicStoreLib.TrackType", "getLength"), findSetterMethod("MusicStoreLib.TrackType", "setLength", "com.liquid_technologies.ltxmllib21.Duration"), null, null, com.liquid_technologies.ltxmllib21.Conversions.ConversionType.TYPE_DURATION, null, com.liquid_technologies.ltxmllib21.WhitespaceRule.COLLAPSE, new com.liquid_technologies.ltxmllib21.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1), null)
};
}
return __elementInfo;
}
protected com.liquid_technologies.ltxmllib21.AttributeInfo[] getClassAttributeInfo() throws Exception {
if (__attributeInfo==null) {
__attributeInfo = new com.liquid_technologies.ltxmllib21.AttributeInfo[] {
};
}
return __attributeInfo;
}
// ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
// Add Additional Methods and members here...
// ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
}
|
| Main Menu | Samples List |