private void verify ( ) { Utils . require ( ! Utils . isEmpty ( m_name ) , "Field name is required" ) ; Utils . require ( m_type != null , "Field type is required" ) ; // If an 'inverse' or 'table' was specified, type must be LINK or XLINK. Utils . require ( m_linkInverse == null || m_type . isLinkType ( ) , "'inverse' not allowed for this field type: " + m_name ) ; Utils . require ( m_linkExtent == null || m_type . isLinkType ( ) , "'table' not allowed for this field type: " + m_name ) ; // LINK and XLINK require an 'inverse'. Utils . require ( ! m_type . isLinkType ( ) || m_linkInverse != null , "Missing 'inverse' option: " + m_name ) ; // XLINK requires a junction field: default is "_ID". if ( ! Utils . isEmpty ( m_junctionField ) ) { Utils . require ( m_type == FieldType . XLINK , "'junction' is only allowed for xlinks" ) ; } else if ( m_type == FieldType . XLINK ) { m_junctionField = "_ID" ; } // If collection was not explicitly set, set to true for links and false for scalars if ( ! m_bIsCollection && m_type . isLinkType ( ) ) { m_bIsCollection = true ; } // 'analyzer' can only be set for scalar field types, but don't verify value here. Utils . require ( m_analyzerName == null || m_type . isScalarType ( ) , "'analyzer' can only be specified for scalar field types: " + m_analyzerName ) ; // If this is a binary field, ensure "encoding" is set. if ( m_encoding != null ) { Utils . require ( m_type == FieldType . BINARY , "'encoding' is only valid for binary fields" ) ; } else if ( m_type == FieldType . BINARY ) { m_encoding = EncodingType . getDefaultEncoding ( ) ; } // Binary fields cannot be collections. Utils . require ( m_type != FieldType . BINARY || ! m_bIsCollection , "Binary fields cannot be collections (multi-valued)" ) ; }
Verify that this field definition is complete and coherent .