public class FormResource extends BaseOpenmrsObject implements CustomValueDescriptor, SingleCustomValue<FormResource>
Constructor and Description |
---|
FormResource() |
FormResource(FormResource old)
Create a copy of a provided FormResource, ignoring the uuid and id of the original
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDatatypeClassname()
Return the name of a class that implements
CustomDatatype . |
java.lang.String |
getDatatypeConfig()
May be null.
|
FormResource |
getDescriptor()
The metadata describing this custom value
|
Form |
getForm()
gets the form
|
java.lang.Integer |
getFormResourceId()
gets the form resource id
|
java.lang.String |
getHandlerConfig()
May be null.
|
java.lang.Integer |
getId() |
java.lang.String |
getName()
gets the name of the resource
|
java.lang.String |
getPreferredHandlerClassname()
May be null.
|
java.lang.Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
java.lang.String |
getValueReference() |
boolean |
isDirty() |
void |
setDatatypeClassname(java.lang.String datatypeClassname) |
void |
setDatatypeConfig(java.lang.String datatypeConfig) |
void |
setForm(Form form)
sets the form
|
void |
setFormResourceId(java.lang.Integer formResourceId)
sets the form resource id
|
void |
setHandlerConfig(java.lang.String handlerConfig) |
void |
setId(java.lang.Integer id) |
void |
setName(java.lang.String name)
sets the name of the resource
|
void |
setPreferredHandlerClassname(java.lang.String preferredHandlerClassname) |
<T> void |
setValue(T typedValue)
Sets the typed value.
|
void |
setValueReferenceInternal(java.lang.String valueToPersist)
Directly set the String value that OpenMRS should persist in the database
in a varchar column.
|
public FormResource()
public FormResource(FormResource old)
old
- the original FormResource to be copiedpublic java.lang.Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
public Form getForm()
public void setForm(Form form)
form
- the formpublic java.lang.Integer getFormResourceId()
public void setFormResourceId(java.lang.Integer formResourceId)
formResourceId
- the form resource's idpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the resourcepublic java.lang.String getDatatypeClassname()
CustomValueDescriptor
CustomDatatype
.getDatatypeClassname
in interface CustomValueDescriptor
CustomValueDescriptor.getDatatypeClassname()
public void setDatatypeClassname(java.lang.String datatypeClassname)
datatypeClassname
- the datatypeClassname to setpublic java.lang.String getDatatypeConfig()
CustomValueDescriptor
getDatatypeConfig
in interface CustomValueDescriptor
CustomValueDescriptor.getDatatypeConfig()
public void setDatatypeConfig(java.lang.String datatypeConfig)
datatypeConfig
- the datatypeConfig to setpublic java.lang.String getPreferredHandlerClassname()
CustomValueDescriptor
getPreferredHandlerClassname
in interface CustomValueDescriptor
CustomDatatypeHandler
chosen by the
system administrator for this attribute type.CustomValueDescriptor.getPreferredHandlerClassname()
public void setPreferredHandlerClassname(java.lang.String preferredHandlerClassname)
preferredHandlerClassname
- the preferredHandlerClassname to setpublic java.lang.String getHandlerConfig()
CustomValueDescriptor
getHandlerConfig
in interface CustomValueDescriptor
CustomValueDescriptor.getHandlerConfig()
public void setHandlerConfig(java.lang.String handlerConfig)
handlerConfig
- the handlerConfig to setpublic FormResource getDescriptor()
SingleCustomValue
getDescriptor
in interface SingleCustomValue<FormResource>
SingleCustomValue.getDescriptor()
public java.lang.String getValueReference()
getValueReference
in interface SingleCustomValue<FormResource>
SingleCustomValue.getValueReference()
public java.lang.Object getValue() throws InvalidCustomValueException
SingleCustomValue
CustomDatatype.fromReferenceString(String)
.)getValue
in interface SingleCustomValue<FormResource>
InvalidCustomValueException
SingleCustomValue.getValue()
public <T> void setValue(T typedValue) throws InvalidCustomValueException
SingleCustomValue
CustomDatatype#toReferenceString(Object)
setValue
in interface SingleCustomValue<FormResource>
InvalidCustomValueException
SingleCustomValue.setValue(java.lang.Object)
public void setValueReferenceInternal(java.lang.String valueToPersist) throws InvalidCustomValueException
SingleCustomValue
InvalidCustomValueException
if it's invalid, rather than setting it blindly.
If you are coding against the OpenMRS API, you should use SingleCustomValue.setValue(Object)
instead.setValueReferenceInternal
in interface SingleCustomValue<FormResource>
InvalidCustomValueException
SingleCustomValue.setValueReferenceInternal(java.lang.String)
public boolean isDirty()
isDirty
in interface SingleCustomValue<FormResource>
CustomDatatype.save(Object, String)
needs to be calledSingleCustomValue.isDirty()
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.