001package com.example.metaschema; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; 004import gov.nist.secauto.metaschema.core.model.IBoundObject; 005import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 006import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; 007import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 008import java.lang.Override; 009import java.lang.String; 010import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 011import org.apache.commons.lang3.builder.ToStringStyle; 012 013/** 014 * Used in JSON (and similar formats) to identify a flag that will be used as the property name in an object hold a collection of sibling objects. Requires that siblings must never share <code>json-key</code> values. 015 */ 016@MetaschemaAssembly( 017 formalName = "JSON Key", 018 description = "Used in JSON (and similar formats) to identify a flag that will be used as the property name in an object hold a collection of sibling objects. Requires that siblings must never share `json-key` values.", 019 name = "json-key", 020 moduleClass = MetaschemaModelModule.class 021) 022public class JsonKey implements IBoundObject { 023 private final IMetaschemaData __metaschemaData; 024 025 /** 026 * "References the flag that will serve as the JSON key." 027 */ 028 @BoundFlag( 029 formalName = "JSON Key Flag Reference", 030 description = "References the flag that will serve as the JSON key.", 031 name = "flag-ref", 032 required = true, 033 typeAdapter = TokenAdapter.class 034 ) 035 private String _flagRef; 036 037 public JsonKey() { 038 this(null); 039 } 040 041 public JsonKey(IMetaschemaData data) { 042 this.__metaschemaData = data; 043 } 044 045 @Override 046 public IMetaschemaData getMetaschemaData() { 047 return __metaschemaData; 048 } 049 050 public String getFlagRef() { 051 return _flagRef; 052 } 053 054 public void setFlagRef(String value) { 055 _flagRef = value; 056 } 057 058 @Override 059 public String toString() { 060 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 061 } 062}