Class ResourceSchemaUtil


  • public class ResourceSchemaUtil
    extends Object
    Various utility methods related to resource schema handling, including sophisticated object definition lookup.
    • Constructor Detail

      • ResourceSchemaUtil

        public ResourceSchemaUtil()
    • Method Detail

      • findObjectDefinitionPrecisely

        @Contract("   _,  null,  null,  null ->  null;   _,     _,     _, !null -> !null;   _, !null, !null,     _ -> !null;   _,  null, !null,     _ ->  fail")
        public static ResourceObjectDefinition findObjectDefinitionPrecisely​(@NotNull
                                                                             @NotNull ResourceType resource,
                                                                             @Nullable
                                                                             @Nullable ShadowKindType kind,
                                                                             @Nullable
                                                                             @Nullable String intent,
                                                                             @Nullable
                                                                             @Nullable QName objectClassName)
                                                                      throws SchemaException,
                                                                             ConfigurationException
        Determines object type/class definition in a precise way. The decision is based on kind/intent/objectclass triple, and later enriched by aux object class names. Basic schema is: . No kind, intent, nor object class is present: No definition (the `null` value) is returned. . Kind is not present -> the decision is based on the object class name: .. if there is a type definition (for given object class name) marked as "default for object class", it is returned; .. otherwise, the object class definition (refined, if there's any; raw otherwise) is returned. . Kind is present: .. if intent is specified, then the type definition for given kind/intent is found (and its object class is checked for equality with the specified one, if there's any); .. if no intent is specified, then "default for kind" definition is looked for. !!! *BEWARE* This method is really complex. If at all possible, please consider using specific lookup methods present in ResourceSchema. Most probably we'll remove this method in the future. !!!
        Throws:
        SchemaException
        ConfigurationException
        See Also:
        ResourceObjectDefinitionResolver.findObjectDefinition(ResourceSchema, ShadowKindType, String, QName), ResourceSchema.findDefinitionForObjectClass(QName)