org.jbind.xml.schema.compiler
Interface ICartridge

All Superinterfaces:
IBinder, IComponentVisitor
All Known Implementing Classes:
AbstractCartridge

public interface ICartridge
extends IComponentVisitor, IBinder


Method Summary
 IBinding createBuiltInBinding(IComponent aComponent)
           
 IFileInfo generate(IComponent aComponent)
          Generates code for the specified component.
 int getCartridgeNo()
           
 IMessage getEditHint(java.io.File aFile, IComponent aComponent)
          Gets a message that is output if a file generated by this cartridge must be edited manually.
 java.lang.String getNameForPackage(IComponent aComponent, java.lang.String aPackage)
          Gets the name of a component when referenced from a specified package.
 java.lang.String getNamePrefix(IComponent aComponent)
          Gets the name prefix.
 java.lang.String getNameSuffix(IComponent aComponent)
          Gets the name suffix.
 java.lang.String getSubPackage()
          Gets the sub package.
 java.lang.String getUsableFqName(IComponent aComponent)
           
 void initCartridge(ICartridgeMgr aManager)
           
 boolean isUpToDate(java.io.Reader aReader, IFileInfo aFileInfo)
          Checks if the previous code is up to date.
 boolean overwrite()
          Determines if any previous code is overwritten.
 void setCartridgeNo(int aNumber)
           
 
Methods inherited from interface org.jbind.xml.core.cmp.IComponentVisitor
shallVisitSubComponents, visitAllDeclEnd, visitAllDeclStart, visitAllRefEnd, visitAllRefStart, visitAnySimpleTypeEnd, visitAnySimpleTypeStart, visitAnyTypeEnd, visitAnyTypeStart, visitAtomicTypeEnd, visitAtomicTypeStart, visitAttrDeclEnd, visitAttrDeclStart, visitAttrGroupDeclEnd, visitAttrGroupDeclStart, visitAttrGroupRefEnd, visitAttrGroupRefStart, visitAttrRefEnd, visitAttrRefStart, visitAttrWildcardEnd, visitAttrWildcardStart, visitChoiceDeclEnd, visitChoiceDeclStart, visitChoiceRefEnd, visitChoiceRefStart, visitComplexTypeEnd, visitComplexTypeStart, visitElemDeclEnd, visitElemDeclStart, visitElemRefEnd, visitElemRefStart, visitElemWildcardEnd, visitElemWildcardStart, visitListTypeEnd, visitListTypeStart, visitNotationEnd, visitNotationStart, visitSequenceDeclEnd, visitSequenceDeclStart, visitSequenceRefEnd, visitSequenceRefStart, visitUnionTypeEnd, visitUnionTypeStart
 
Methods inherited from interface org.jbind.xml.schema.compiler.IBinder
createGlobalAnyTypeBinding, createGlobalAttrDeclBinding, createGlobalAttrGroupBinding, createGlobalElemDeclBinding, createGlobalGroupDeclBinding, createInnerAnyTypeBinding, createInnerAttrDeclBinding, createInnerAttrGroupBinding, createInnerAttrRefBinding, createInnerAttrWildcardBinding, createInnerElemDeclBinding, createInnerElemRefBinding, createInnerElemWildcardBinding, createInnerGroupRefOrDeclBinding
 

Method Detail

getSubPackage

public java.lang.String getSubPackage()
Gets the sub package. The file generated by the cartridge can be located in a common sub package. The cartridge sub package is appended to the schema (root) package.

Returns:
(optional).

getNamePrefix

public java.lang.String getNamePrefix(IComponent aComponent)
Gets the name prefix. The name prefix is used when the name of a binding is determined.

Returns:
(required).

getNameSuffix

public java.lang.String getNameSuffix(IComponent aComponent)
Gets the name suffix. The name suffix is used when the name of a binding is determined.

Returns:
(required).

getCartridgeNo

public int getCartridgeNo()

setCartridgeNo

public void setCartridgeNo(int aNumber)

initCartridge

public void initCartridge(ICartridgeMgr aManager)

generate

public IFileInfo generate(IComponent aComponent)
                   throws XmlException
Generates code for the specified component.

Parameters:
aComponent - (required).
Returns:
(optional). The generated code.
Throws:
XmlException

overwrite

public boolean overwrite()
Determines if any previous code is overwritten.

Returns:
Returns true iff previous code is overwritten.

isUpToDate

public boolean isUpToDate(java.io.Reader aReader,
                          IFileInfo aFileInfo)
                   throws java.lang.Exception
Checks if the previous code is up to date.

Parameters:
aReader - (required). Reads the previous code.
aFileInfo - (required). The file info returned from the generate method.
Returns:
Returns true iff the previous code is up to date.
Throws:
java.lang.Exception

getEditHint

public IMessage getEditHint(java.io.File aFile,
                            IComponent aComponent)
Gets a message that is output if a file generated by this cartridge must be edited manually. This method may only be called if overwrite returns false.

Parameters:
aFile - (required).
aComponent - (required).
Returns:
(required).

getUsableFqName

public java.lang.String getUsableFqName(IComponent aComponent)

getNameForPackage

public java.lang.String getNameForPackage(IComponent aComponent,
                                          java.lang.String aPackage)
Gets the name of a component when referenced from a specified package. If a component is referenced from the same package it belongs to then only the name is returned otherwise the fully qualified name.

Parameters:
aComponent - (required).
aPackage - (required).
Returns:
(required).

createBuiltInBinding

public IBinding createBuiltInBinding(IComponent aComponent)