/** * Prevalidate attributes of element in isolation. Note that this adds the format information to * the context, which is necessary because the string attributes for values need to have access to * the format information for their own prevalidation. This is the only type of registration which * is done during the prevalidation pass. * * @param vctx validation context */ public void prevalidate(ValidationContext vctx) { // prevalidate this format if (m_typeName != null) { m_type = vctx.getClassInfo(m_typeName); if (m_type != null) { m_stringAttrs.setType(m_type); m_stringAttrs.prevalidate(vctx); } else { vctx.addFatal("Unable to find type " + m_typeName); } } else { vctx.addFatal("Missing required type name"); } // now try adding to context (except when run during setup) - kludgy if (vctx.getParentElement() != null) { vctx.getFormatDefinitions().addFormat(this, vctx); } super.prevalidate(vctx); }
/* (non-Javadoc) * @see org.jibx.binding.model.ElementBase#validate(org.jibx.binding.model.ValidationContext) */ public void validate(ValidationContext vctx) { m_stringAttrs.validate(vctx); super.validate(vctx); }
/** * Set deserializer method name. * * @param fully qualified class and method name for deserializer */ public void setDeserializerName(String name) { m_stringAttrs.setDeserializerName(name); }
/** * Get base format information. This method is only usable after a call to {@link #validate}. * * @return base format element (or <code>null</code> if none) */ public FormatElement getBaseFormat() { return m_stringAttrs.getBaseFormat(); }
/** * Get deserializer method information. This call is only meaningful after validation. * * @return deserializer information (or <code>null</code> if none) */ public IClassItem getDeserializer() { return m_stringAttrs.getDeserializer(); }
/** * Get deserializer name. * * @return fully qualified class and method name for deserializer (or <code>null</code> if none) */ public String getDeserializerName() { return m_stringAttrs.getDeserializerName(); }
/** * Set default value text. * * @param value default value text */ public void setDefaultText(String value) { m_stringAttrs.setDefaultText(value); }
/** * Get default value. This call is only meaningful after validation. * * @return default value object */ public Object getDefault() { return m_stringAttrs.getDefault(); }
/** * Get default value text. * * @return default value text */ public String getDefaultText() { return m_stringAttrs.getDefaultText(); }