static int hashCode(final @NonNull IdentityrefTypeDefinition type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getIdentities()); }
@Override public boolean equals(final Object obj) { return IdentityrefTypeDefinition.equals(this, obj); } }
@Override public Set<IdentitySchemaNode> getIdentities() { return getBaseType().getIdentities(); }
private void processTypeDef(final TypeDefinition<?> leafTypeDef, final JSONObject property) throws JSONException { if (leafTypeDef instanceof BinaryTypeDefinition) { processBinaryType((BinaryTypeDefinition) leafTypeDef, property); } else if (leafTypeDef instanceof BitsTypeDefinition) { processBitsType((BitsTypeDefinition) leafTypeDef, property); } else if (leafTypeDef instanceof EnumTypeDefinition) { processEnumType((EnumTypeDefinition) leafTypeDef, property); } else if (leafTypeDef instanceof IdentityrefTypeDefinition) { property.putOpt(TYPE_KEY, ((IdentityrefTypeDefinition) leafTypeDef).getIdentity().getQName().getLocalName()); } else if (leafTypeDef instanceof StringTypeDefinition) { processStringType((StringTypeDefinition) leafTypeDef, property); } else if (leafTypeDef instanceof UnionTypeDefinition) { processUnionType((UnionTypeDefinition) leafTypeDef, property); } else { String jsonType = jsonTypeFor(leafTypeDef); if (jsonType == null) { jsonType = "object"; } property.putOpt(TYPE_KEY, jsonType); } }
@VisibleForTesting static void write(final @NonNull ValueWriter writer, final @NonNull IdentityrefTypeDefinition type, final @NonNull Object value, final QNameModule parent) throws XMLStreamException { if (value instanceof QName) { final QName qname = (QName) value; //in case parent is present and same as element namespace write value without namespace if (qname.getNamespace().equals(parent.getNamespace())) { writer.writeCharacters(qname.getLocalName()); } else { final String ns = qname.getNamespace().toString(); final String prefix = "x"; writer.writeNamespace(prefix, ns); writer.writeCharacters(prefix + ':' + qname.getLocalName()); } } else { final QName qname = type.getQName(); LOG.debug("Value of {}:{} is not a QName but {}", qname.getNamespace(), qname.getLocalName(), value.getClass()); writer.writeToStringCharacters(value); } }
static boolean equals(final @NonNull IdentityrefTypeDefinition type, final @Nullable Object obj) { if (type == obj) { return true; } final IdentityrefTypeDefinition other = TypeDefinitions.castIfEquals(IdentityrefTypeDefinition.class, type, obj); return other != null && type.getIdentities().equals(other.getIdentities()); }
QName baseIdQName = idref.getIdentity().getQName(); Module module = schemaContext.findModuleByNamespaceAndRevision(baseIdQName.getNamespace(), baseIdQName.getRevision());
static int hashCode(final @NonNull IdentityrefTypeDefinition type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getIdentities()); }
static boolean equals(final @NonNull IdentityrefTypeDefinition type, final @Nullable Object obj) { if (type == obj) { return true; } final IdentityrefTypeDefinition other = TypeDefinitions.castIfEquals(IdentityrefTypeDefinition.class, type, obj); return other != null && type.getIdentities().equals(other.getIdentities()); }
@Override public boolean equals(final Object obj) { return IdentityrefTypeDefinition.equals(this, obj); } }
@Override public Set<IdentitySchemaNode> getIdentities() { return baseType().getIdentities(); }
@Override public boolean equals(final Object obj) { return IdentityrefTypeDefinition.equals(this, obj); }
@Override public Set<IdentitySchemaNode> getIdentities() { return getBaseType().getIdentities(); }
@Override public boolean equals(final Object obj) { return IdentityrefTypeDefinition.equals(this, obj); }
private void emitIdentityrefSpecification(final IdentityrefTypeDefinition typeDefinition) { emitBaseIdentities(typeDefinition.getIdentities()); }
@Override public boolean equals(final Object obj) { return IdentityrefTypeDefinition.equals(this, obj); }
@Override public Set<IdentitySchemaNode> getIdentities() { return baseType().getIdentities(); }
@Override public boolean equals(final Object obj) { return IdentityrefTypeDefinition.equals(this, obj); }
static String toString(final @NonNull IdentityrefTypeDefinition type) { return TypeDefinitions.toStringHelper(type).add("identities", type.getIdentities()).toString(); } }
static String toString(final @NonNull IdentityrefTypeDefinition type) { return TypeDefinitions.toStringHelper(type).add("identities", type.getIdentities()).toString(); } }