diff --git a/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/PrismContext.java b/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/PrismContext.java index 4b0b455d8cb..bea293d3490 100644 --- a/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/PrismContext.java +++ b/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/PrismContext.java @@ -7,19 +7,29 @@ package com.evolveum.midpoint.prism; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import javax.xml.namespace.QName; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; + import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.prism.crypto.ProtectorCreator; import com.evolveum.midpoint.prism.delta.DeltaFactory; import com.evolveum.midpoint.prism.delta.ObjectDelta; import com.evolveum.midpoint.prism.delta.builder.S_ItemEntry; -import com.evolveum.midpoint.prism.marshaller.JaxbDomHack; import com.evolveum.midpoint.prism.marshaller.ParsingMigrator; import com.evolveum.midpoint.prism.path.CanonicalItemPath; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.path.UniformItemPath; import com.evolveum.midpoint.prism.polystring.PolyStringNormalizer; -import com.evolveum.midpoint.prism.query.QueryFactory; import com.evolveum.midpoint.prism.query.QueryConverter; +import com.evolveum.midpoint.prism.query.QueryFactory; import com.evolveum.midpoint.prism.query.builder.S_FilterEntryOrEmpty; import com.evolveum.midpoint.prism.schema.SchemaFactory; import com.evolveum.midpoint.prism.schema.SchemaRegistry; @@ -31,20 +41,8 @@ import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringNormalizerConfigurationType; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.w3c.dom.Element; -import org.w3c.dom.ls.LSResourceResolver; -import org.xml.sax.SAXException; - -import javax.xml.namespace.QName; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; /** - * * @author semancik * @author mederly */ @@ -74,7 +72,7 @@ public interface PrismContext extends ProtectorCreator { PolyStringNormalizer getDefaultPolyStringNormalizer(); /** - * Returns the default protector. (TODO) + * Returns the default protector. */ Protector getDefaultProtector(); @@ -85,6 +83,7 @@ public interface PrismContext extends ProtectorCreator { /** * Creates a parser ready to process the given file. + * * @param file File to be parsed. * @return Parser that can be invoked to retrieve the (parsed) content of the file. */ @@ -93,6 +92,7 @@ public interface PrismContext extends ProtectorCreator { /** * Creates a parser ready to process data from the given input stream. + * * @param stream Input stream to be parsed. * @return Parser that can be invoked to retrieve the (parsed) content of the input stream. */ @@ -101,8 +101,10 @@ public interface PrismContext extends ProtectorCreator { /** * Creates a parser ready to process data from the given string. - * @param data String with the data to be parsed. It has be in UTF-8 encoding. - * (For other encodings please use InputStream or File source.) + * Format/language of the data will be auto-detected, so the typically following + * {@link PrismParser#language(String)} can be omitted. + * + * @param data String with the data to be parsed. * @return Parser that can be invoked to retrieve the (parsed) content. */ @NotNull @@ -110,6 +112,7 @@ public interface PrismContext extends ProtectorCreator { /** * Creates a parser ready to process data from the given XNode tree. + * * @param xnode XNode tree with the data to be parsed. * @return Parser that can be invoked to retrieve the (parsed) content. */ @@ -118,6 +121,7 @@ public interface PrismContext extends ProtectorCreator { /** * Creates a parser ready to process data from the given DOM element. + * * @param element Element with the data to be parsed. * @return Parser that can be invoked to retrieve the (parsed) content. */ @@ -166,6 +170,7 @@ void adopt(PrismContainerValue void adopt(PrismContainerValue void adopt(PrismContainerValue void adopt(PrismContainerValue void adopt(PrismContainerValue void adopt(PrismContainerValue void adopt(PrismContainerValue PrismObject createObject(@NotNull Class clazz) throws SchemaException; + @NotNull PrismObject createObject(@NotNull Class clazz) throws SchemaException; /** * Creates a new Objectable of a given type. + * * @param clazz Static type of the object to be created. * @return New PrismObject's objectable content. * @throws SchemaException If a definition for the given class couldn't be found. */ - @NotNull - O createObjectable(@NotNull Class clazz) throws SchemaException; + @NotNull O createObjectable(@NotNull Class clazz) throws SchemaException; /** * Creates a new PrismObject of a given static type. It is expected that the type exists, so any SchemaExceptions * will be thrown as run-time exception. + * * @param clazz Static type of the object to be created. * @return New PrismObject. */ - @NotNull - PrismObject createKnownObject(@NotNull Class clazz); + @NotNull PrismObject createKnownObject(@NotNull Class clazz); /** * Creates a new Objectable of a given static type. It is expected that the type exists, so any SchemaExceptions * will be thrown as run-time exception. + * * @param clazz Static type of the object to be created. * @return New PrismObject's objectable content. */ - @NotNull - O createKnownObjectable(@NotNull Class clazz); + @NotNull O createKnownObjectable(@NotNull Class clazz); PrismMonitor getMonitor(); @@ -265,7 +275,7 @@ void adopt(PrismContainerValue * VERY EXPERIMENTAL. Maybe we should simply use t:ObjectReferenceType in such cases. */ @Experimental @@ -328,7 +338,7 @@ default ItemPath toPath(ItemPathType path) { /** * Access point to the "old" way of creating deltas. It is generally considered deprecated. * DeltaBuilder (accessed via deltaFor method) should be used instead. - * + *

* However, because there is some functionality (like creation of empty deltas) that is not covered by the delta * builder, we keep this method not marked as deprecated. Only particular parts of DeltaFactory are marked as deprecated. */ @@ -338,7 +348,7 @@ default ItemPath toPath(ItemPathType path) { /** * Access point to the "old" way of creating queries, filters and paging instructions. * It is generally considered deprecated. QueryBuilder (accessed via queryFor method) should be used instead. - * + *

* However, because there is some functionality (like creation of standalone paging instructions) that is not covered * by the query builder, we keep this method not marked as deprecated. Only particular parts of QueryFactory are marked * as deprecated.