Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1495

Covariant return type for Model's PrefixMapping methods.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Jena 3.6.0
    • Fix Version/s: Jena 3.7.0
    • Component/s: Core
    • Labels:

      Description

      The Model interface inherits several methods from PrefixMapping which return this.
      The return type of these methods can be refined to allow call chaining with the Model object.

      There appear to be two concrete implementations of Model which override the PrefixMapping methods: ModelCom and SecuredModelImpl. Steps to add covariant return types for prefix mapping are as follows.

      Add these six methods to the Model interface.

      1. Model setNsPrefix( String prefix, String uri );
      2. Model removeNsPrefix( String prefix );
      3. Model clearNsPrefixMap();
      4. Model setNsPrefixes( PrefixMapping other );
      5. Model setNsPrefixes( Map<String, String> map );
      6. Model withDefaultMappings( PrefixMapping map );

      ...and update ModelCom accordingly.

      Add these six methods to the SecuredModel interface.

      1. SecuredModel setNsPrefix( String prefix, String uri );
      2. SecuredModel removeNsPrefix( String prefix ); // This method is already defined.
      3. SecuredModel clearNsPrefixMap();
      4. SecuredModel setNsPrefixes( PrefixMapping other );
      5. SecuredModel setNsPrefixes( Map<String, String> map );
      6. SecuredModel withDefaultMappings( PrefixMapping map );

      ...and update SecuredModelImpl accordingly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ajs6f Adam Soroka
                Reporter:
                jaco0646 Adam Jacobs
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: