ist.palcom.resource.descriptor
Class AssemblyDescriptor

java.lang.Object
  extended by ist.palcom.resource.descriptor.ASTNode
      extended by ist.palcom.resource.descriptor.AbstractXMLRepresentable
          extended by ist.palcom.resource.descriptor.Info
              extended by ist.palcom.resource.descriptor.InfoRoot
                  extended by ist.palcom.resource.descriptor.AssemblyDescriptor
All Implemented Interfaces:
XMLRepresentable, java.lang.Cloneable

public class AssemblyDescriptor
extends InfoRoot
implements java.lang.Cloneable


Field Summary
protected  boolean getAssemblyLabel_visited
           
 
Fields inherited from class ist.palcom.resource.descriptor.InfoRoot
VERSION_DELIM
 
Fields inherited from class ist.palcom.resource.descriptor.AbstractXMLRepresentable
getBrowserLabel_visited
 
Fields inherited from class ist.palcom.resource.descriptor.ASTNode
CHANGE, children, encloseInBraces_visited, generatedWithCacheCycle, generatedWithCircularEnabled, generatedWithComponentCheck, getErrorList_visited, getIndent_visited, getParentPRDAssembly_visited, getPrettyClosingString_visited, getPrettyString_visited, IN_CIRCLE, LAST_CYCLE, numChildren, parent, prettyPrintChildren_visited, RESET_CYCLE
 
Constructor Summary
AssemblyDescriptor()
           
AssemblyDescriptor(AssemblyInfo initialVer)
           
AssemblyDescriptor(java.lang.String format)
           
AssemblyDescriptor(java.lang.String p0, java.lang.String p1, java.lang.String p2, List p3)
           
 
Method Summary
 void addAssemblyInfo(AssemblyInfo node)
           
 void addChildFromXMLElement(XMLRepresentable child)
          The implementation up here is empty.
 boolean addVersion(AssemblyInfo ai)
          Add a version to the AssemblyDescriptor, if it matches previously set name/version or name is unset.
 java.lang.Object clone()
           
 ASTNode copy()
           
 AssemblyDescriptor Define_AssemblyDescriptor_ad(ASTNode caller, ASTNode child)
           
 java.util.List diffAdded(AssemblyDescriptor ad)
          Return the set of versions present in ad but not in this I.e, ad - this If ad and this do not share the same base version, the result is the empty set.
 void flushCache()
           
 ASTNode fullCopy()
           
 AssemblyInfo getAssemblyInfo(int i)
           
 List getAssemblyInfoList()
           
 List getAssemblyInfoListNoTransform()
           
 java.lang.String getAssemblyLabel()
           
 java.lang.Object[] getChildArray()
          Helper method for the TreeView
 java.lang.String getFormat()
           
 java.lang.String getName()
           
 int getNumAssemblyInfo()
           
 java.lang.String getTagName()
           
 java.lang.String getVersion()
           
 boolean hasAssemblyInfo(AssemblyInfo ai)
          Deprecated.  
 void initializeFromElement(XmlPullParser parser)
          Initialize the XMLRepresentable from the element where the parser is currently standing.
 boolean isAboutTheSameEntityAs(Info info)
           
 boolean isNewVersion(AssemblyInfo ai)
           
 boolean isRelatedTo(AssemblyDescriptor ad)
          Checks if ad and this are versions of the same entity, i.e., they share a common ancestor.
 boolean isRelatedTo(AssemblyInfo ai)
          Checks if ai and this are versions of the same entity, i.e., they share a common ancestor.
 boolean isUpdate(AssemblyInfo ai)
           
 void mergeAddedVersionsFrom(AssemblyDescriptor ad)
          Add each version present in ad not present in this to this I.e., after the operation, this will contain the union of the versions in ad and this.
protected  int numChildren()
           
 void setAssemblyInfo(AssemblyInfo node, int i)
           
 void setAssemblyInfoList(List list)
           
 void setFormat(java.lang.String value)
           
 void setName(java.lang.String value)
           
 void setVersion(java.lang.String value)
           
 boolean updateIfNewer(AssemblyInfo ai)
           
 void writeXMLElement(KXmlSerializer serializer)
           
 
Methods inherited from class ist.palcom.resource.descriptor.InfoRoot
getBaseVersion, getCreatingURN, getInitialTimestamp, getLogicalVersion, getParentTimestamp, getParentURN, getParentVersion, getUpdatingTimestamp, getUpdatingURN, tsStr, writeAttributes
 
Methods inherited from class ist.palcom.resource.descriptor.Info
getDeviceURN, getInfoThatEquals, getInfoThatIsAboutTheSameEntityAs, getURN, safeEqual, urnToServiceURN
 
Methods inherited from class ist.palcom.resource.descriptor.AbstractXMLRepresentable
addToAssembly, equals, getBrowserLabel, getXMLData, getXMLData, removeFromAssembly, toString
 
Methods inherited from class ist.palcom.resource.descriptor.ASTNode
addASTtoList, addChild, Define_CommandInfo_ci, Define_Device_parentDevice, Define_Identifier_getLocalName, Define_NetworkNode_lookup, Define_PRDAssembly_ai, Define_PRDSecondOrderList_list, Define_Service_inhCust, Define_Service_inhProv, Define_String_expectedType, Define_Universe_universe, encloseInBraces, getChild, getChildNoTransform, getErrorList, getIDforEditing, getIndent, getIndexOfChild, getNumChild, getParent, getParentPRDAssembly, getPrettyClosingString, getPrettyString, insertChild, prettyprint, prettyPrintChildren, remove, removeChild, reset, resetTree, setChild, setParent, updateIDfromEditor
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

getAssemblyLabel_visited

protected boolean getAssemblyLabel_visited
Constructor Detail

AssemblyDescriptor

public AssemblyDescriptor(AssemblyInfo initialVer)

AssemblyDescriptor

public AssemblyDescriptor(java.lang.String format)

AssemblyDescriptor

public AssemblyDescriptor()

AssemblyDescriptor

public AssemblyDescriptor(java.lang.String p0,
                          java.lang.String p1,
                          java.lang.String p2,
                          List p3)
Method Detail

flushCache

public void flushCache()
Overrides:
flushCache in class InfoRoot

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class InfoRoot
Throws:
java.lang.CloneNotSupportedException

copy

public ASTNode copy()
Overrides:
copy in class ASTNode

fullCopy

public ASTNode fullCopy()
Overrides:
fullCopy in class ASTNode

isAboutTheSameEntityAs

public boolean isAboutTheSameEntityAs(Info info)
Specified by:
isAboutTheSameEntityAs in class Info
Returns:
True if info and this info are for the same entity. This can be true even if they are not completely identical, looking at their whole trees. The equals method for Infos, on the other hand, is implemented to check for that.

getChildArray

public java.lang.Object[] getChildArray()
Description copied from class: ASTNode
Helper method for the TreeView

Overrides:
getChildArray in class ASTNode
Returns:
The (interesting) children of a node, as an Object array possibly bypassing levels in the tree or ignoring certain children.

isRelatedTo

public boolean isRelatedTo(AssemblyInfo ai)
Checks if ai and this are versions of the same entity, i.e., they share a common ancestor.


isRelatedTo

public boolean isRelatedTo(AssemblyDescriptor ad)
Checks if ad and this are versions of the same entity, i.e., they share a common ancestor.


addVersion

public boolean addVersion(AssemblyInfo ai)
Add a version to the AssemblyDescriptor, if it matches previously set name/version or name is unset.

Returns:
true on sucess

isNewVersion

public boolean isNewVersion(AssemblyInfo ai)

isUpdate

public boolean isUpdate(AssemblyInfo ai)

updateIfNewer

public boolean updateIfNewer(AssemblyInfo ai)

hasAssemblyInfo

public boolean hasAssemblyInfo(AssemblyInfo ai)
Deprecated. 

Aux method, for implementing update/merge. Made public for use in the test case (which is why it is marked as deprecated), it is really an internal method.


diffAdded

public java.util.List diffAdded(AssemblyDescriptor ad)
Return the set of versions present in ad but not in this I.e, ad - this If ad and this do not share the same base version, the result is the empty set.


mergeAddedVersionsFrom

public void mergeAddedVersionsFrom(AssemblyDescriptor ad)
Add each version present in ad not present in this to this I.e., after the operation, this will contain the union of the versions in ad and this. If ad and this do not share the same base version, nothing happens.


getTagName

public java.lang.String getTagName()
Specified by:
getTagName in interface XMLRepresentable
Specified by:
getTagName in class AbstractXMLRepresentable

initializeFromElement

public void initializeFromElement(XmlPullParser parser)
Description copied from interface: XMLRepresentable
Initialize the XMLRepresentable from the element where the parser is currently standing. When calling this method, the parser must be on the start tag of the element. After returning from the method, the parser will be at the end tag of the element.

Specified by:
initializeFromElement in interface XMLRepresentable
Overrides:
initializeFromElement in class InfoRoot

addChildFromXMLElement

public void addChildFromXMLElement(XMLRepresentable child)
Description copied from class: AbstractXMLRepresentable
The implementation up here is empty.

Specified by:
addChildFromXMLElement in interface XMLRepresentable
Overrides:
addChildFromXMLElement in class AbstractXMLRepresentable

writeXMLElement

public void writeXMLElement(KXmlSerializer serializer)
                     throws java.io.IOException
Specified by:
writeXMLElement in interface XMLRepresentable
Throws:
java.io.IOException

numChildren

protected int numChildren()
Overrides:
numChildren in class InfoRoot

setFormat

public void setFormat(java.lang.String value)
Overrides:
setFormat in class InfoRoot

getFormat

public java.lang.String getFormat()
Overrides:
getFormat in class InfoRoot

setName

public void setName(java.lang.String value)
Overrides:
setName in class InfoRoot

getName

public java.lang.String getName()
Overrides:
getName in class InfoRoot

setVersion

public void setVersion(java.lang.String value)
Overrides:
setVersion in class InfoRoot

getVersion

public java.lang.String getVersion()
Overrides:
getVersion in class InfoRoot

setAssemblyInfoList

public void setAssemblyInfoList(List list)

getNumAssemblyInfo

public int getNumAssemblyInfo()

getAssemblyInfo

public AssemblyInfo getAssemblyInfo(int i)

addAssemblyInfo

public void addAssemblyInfo(AssemblyInfo node)

setAssemblyInfo

public void setAssemblyInfo(AssemblyInfo node,
                            int i)

getAssemblyInfoList

public List getAssemblyInfoList()

getAssemblyInfoListNoTransform

public List getAssemblyInfoListNoTransform()

getAssemblyLabel

public java.lang.String getAssemblyLabel()
Overrides:
getAssemblyLabel in class ASTNode

Define_AssemblyDescriptor_ad

public AssemblyDescriptor Define_AssemblyDescriptor_ad(ASTNode caller,
                                                       ASTNode child)