fi.hut.tml.xsmiles.mlfc.xforms.instance
Class InstanceItem

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.instance.InstanceItem
All Implemented Interfaces:
PropertyInheriter

public class InstanceItem
extends java.lang.Object
implements PropertyInheriter


Field Summary
protected  byte[] attachment
          For URI uploads the attachment, if it exists
protected  java.lang.String attachmentFilename
          For URI uploads the attachment filename, if it exists
protected  java.lang.String attachmentMime
          For URI uploads the attachment encoding, if it exists
protected  java.lang.String attachmentURI
          For URI uploads the URI of this attachment, if it exists
protected  java.util.Vector controls
           
protected  Data dataMapper
          the datamapper item for this value
protected  boolean inherited_readonly
          Other constraint values, calculated from the binds
protected  boolean inherited_relevant
          Other constraint values, calculated from the binds
protected  boolean local_readonly
          Other constraint values, calculated from the binds
protected  boolean local_relevant
          Other constraint values, calculated from the binds
protected  int primitiveTypeId
           
protected  boolean required
          Other constraint values, calculated from the binds
protected  java.lang.String schemaError
          the last schema error for this item
protected  boolean schemavalid
          Other constraint values, calculated from the binds
static int TYPE_UNREAD
           
protected  java.lang.String typeLocalName
          the string value of bind's type attribute that should be used for this item
protected  java.lang.String typeNamespace
           
protected  java.lang.String uploadFileName
          The file name of the upload if it exists
protected  boolean xformsvalid
          Other constraint values, calculated from the binds
static java.lang.String XSINS
           
protected  XsiType xsiType
          the xsi:type implementation for this item, may be null
 
Fields inherited from interface fi.hut.tml.xsmiles.mlfc.xforms.instance.PropertyInheriter
PROPERTY_BASE, READONLY_PROPERTY, RELEVANT_PROPERTY
 
Constructor Summary
InstanceItem(InstanceNode owner)
          Constructor - Set the owner, name and namespace.
 
Method Summary
 void addInstanceItemListener(InstanceItemListener control)
           
protected  void checkReadonly()
          tell controls to update state + inherit to children
protected  void checkRelevant()
           
protected  java.lang.String createAttachmentURI()
           
protected  void createDataMapper()
           
 void createURIAttachment(byte[] data, java.lang.String mediaType, java.lang.String filename, boolean createURI)
           
 byte[] getAttachment()
           
 java.lang.String getAttachmentFilename()
           
 java.lang.String getAttachmentMime()
           
 java.lang.String getAttachmentTransfer()
           
 java.lang.String getAttachmentURI()
           
 Data getData()
           
 int getPrimitiveTypeId()
          PSVI type methods
 boolean getReadonly()
          Get the readonly property.
 boolean getRelevant()
          Get the relevant property.
 boolean getRequired()
          Get the required property.
 java.lang.String getSchemaError()
          the last schema error for this item
 boolean getSchemaValid()
          Get the isxformsvalid property.
 java.lang.String getText()
           
 java.lang.String getUploadFileName()
           
 boolean getValid()
           
 boolean getXFormsValid()
          Get the xformsvalid property+required property.
 boolean getXSInil()
           
protected  boolean hasValue()
           
 void inheritProperty(short property, boolean value)
          the parent's readonly status has changed Inheritance Rules: If any ancestor node evaluates to true, this value is treated as true.
 void inheritToChildren(short property, boolean value)
          inherit this property to children
 void nofityXSInilChanged(boolean value)
          the instance element may signal me that xsi:nil has changed then if required=true, validity must be reassessed
 void notifyError(java.lang.Exception e, boolean atSubmission)
          notify this item that there was an error in the value of the instance item.
 void notifyValueChanged()
           
 void removeInstanceItemListener(InstanceItemListener control)
           
 java.lang.Object revalidate()
           
 void setReadonly(boolean a_readonly)
          Set the readonly property.
 void setRelevant(boolean a_relevant)
          Set the relevant property.
 void setRequired(boolean a_required)
          Set the required property.
 void setSchemaError(java.lang.String error)
          the last schema error for this item
 void setSchemaValid(boolean a_isvalid)
          Set the schemavalid property.
 void setUploadFileName(java.lang.String f)
           
 void setXFormsType(java.lang.String local, java.lang.String ns)
          Set the xforms:type property
 void setXFormsValid(boolean a_isvalid)
          Set the xformsvalid property.
 java.lang.String toString()
           
protected  void updateDataMapperInvalid(java.lang.String value)
           
protected  java.lang.Object updateDataMapperValue(java.lang.Object value)
           
protected  void validitySet()
          This method is called internally when the validity status changes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

controls

protected java.util.Vector controls

local_relevant

protected boolean local_relevant
Other constraint values, calculated from the binds


inherited_relevant

protected boolean inherited_relevant
Other constraint values, calculated from the binds


local_readonly

protected boolean local_readonly
Other constraint values, calculated from the binds


inherited_readonly

protected boolean inherited_readonly
Other constraint values, calculated from the binds


required

protected boolean required
Other constraint values, calculated from the binds


xformsvalid

protected boolean xformsvalid
Other constraint values, calculated from the binds


schemavalid

protected boolean schemavalid
Other constraint values, calculated from the binds


uploadFileName

protected java.lang.String uploadFileName
The file name of the upload if it exists


attachmentURI

protected java.lang.String attachmentURI
For URI uploads the URI of this attachment, if it exists


attachment

protected byte[] attachment
For URI uploads the attachment, if it exists


attachmentMime

protected java.lang.String attachmentMime
For URI uploads the attachment encoding, if it exists


attachmentFilename

protected java.lang.String attachmentFilename
For URI uploads the attachment filename, if it exists


schemaError

protected java.lang.String schemaError
the last schema error for this item


dataMapper

protected Data dataMapper
the datamapper item for this value


xsiType

protected XsiType xsiType
the xsi:type implementation for this item, may be null


typeLocalName

protected java.lang.String typeLocalName
the string value of bind's type attribute that should be used for this item


typeNamespace

protected java.lang.String typeNamespace

XSINS

public static final java.lang.String XSINS
See Also:
Constant Field Values

TYPE_UNREAD

public static final int TYPE_UNREAD
See Also:
Constant Field Values

primitiveTypeId

protected int primitiveTypeId
Constructor Detail

InstanceItem

public InstanceItem(InstanceNode owner)
Constructor - Set the owner, name and namespace.

Method Detail

getSchemaError

public java.lang.String getSchemaError()
the last schema error for this item


setSchemaError

public void setSchemaError(java.lang.String error)
the last schema error for this item


toString

public java.lang.String toString()

setXFormsType

public void setXFormsType(java.lang.String local,
                          java.lang.String ns)
Set the xforms:type property


inheritToChildren

public void inheritToChildren(short property,
                              boolean value)
inherit this property to children

Specified by:
inheritToChildren in interface PropertyInheriter

setRelevant

public void setRelevant(boolean a_relevant)
Set the relevant property.


checkRelevant

protected void checkRelevant()

getRelevant

public boolean getRelevant()
Get the relevant property.


setXFormsValid

public void setXFormsValid(boolean a_isvalid)
Set the xformsvalid property.


getXFormsValid

public boolean getXFormsValid()
Get the xformsvalid property+required property.


getValid

public boolean getValid()

getXSInil

public boolean getXSInil()

hasValue

protected boolean hasValue()

setSchemaValid

public void setSchemaValid(boolean a_isvalid)
Set the schemavalid property.


validitySet

protected void validitySet()
This method is called internally when the validity status changes


getSchemaValid

public boolean getSchemaValid()
Get the isxformsvalid property.


setRequired

public void setRequired(boolean a_required)
Set the required property.


getRequired

public boolean getRequired()
Get the required property.


setReadonly

public void setReadonly(boolean a_readonly)
Set the readonly property.


checkReadonly

protected void checkReadonly()
tell controls to update state + inherit to children


getReadonly

public boolean getReadonly()
Get the readonly property.


getUploadFileName

public java.lang.String getUploadFileName()

setUploadFileName

public void setUploadFileName(java.lang.String f)

addInstanceItemListener

public void addInstanceItemListener(InstanceItemListener control)

removeInstanceItemListener

public void removeInstanceItemListener(InstanceItemListener control)

notifyValueChanged

public void notifyValueChanged()

getText

public java.lang.String getText()

nofityXSInilChanged

public void nofityXSInilChanged(boolean value)
the instance element may signal me that xsi:nil has changed then if required=true, validity must be reassessed


notifyError

public void notifyError(java.lang.Exception e,
                        boolean atSubmission)
notify this item that there was an error in the value of the instance item. This can be schema validity, constraint, required etc.


getPrimitiveTypeId

public int getPrimitiveTypeId()
PSVI type methods


revalidate

public java.lang.Object revalidate()
                            throws org.apache.xerces.impl.dv.InvalidDatatypeValueException
Throws:
org.apache.xerces.impl.dv.InvalidDatatypeValueException

createDataMapper

protected void createDataMapper()

updateDataMapperInvalid

protected void updateDataMapperInvalid(java.lang.String value)

updateDataMapperValue

protected java.lang.Object updateDataMapperValue(java.lang.Object value)

getData

public Data getData()

inheritProperty

public void inheritProperty(short property,
                            boolean value)
the parent's readonly status has changed Inheritance Rules: If any ancestor node evaluates to true, this value is treated as true. Otherwise, the local value is used. Note: This is the equivalent of taking the logical OR of the evaluated readonly property on the local and every ancestor node. the parent's relevant status has changed Inheritance Rules: If any ancestor node evaluates to XPath false, this value is treated as false. Otherwise, the local value is used. Note: This is the equivalent of taking the logical AND of the evaluated relevant property on the local and every ancestor node.

Specified by:
inheritProperty in interface PropertyInheriter

createURIAttachment

public void createURIAttachment(byte[] data,
                                java.lang.String mediaType,
                                java.lang.String filename,
                                boolean createURI)

createAttachmentURI

protected java.lang.String createAttachmentURI()

getAttachment

public byte[] getAttachment()

getAttachmentURI

public java.lang.String getAttachmentURI()

getAttachmentMime

public java.lang.String getAttachmentMime()

getAttachmentFilename

public java.lang.String getAttachmentFilename()

getAttachmentTransfer

public java.lang.String getAttachmentTransfer()


X-Smiles 1.2