Class RoleBasedAuthorizationStrategy.ConverterImpl

  • All Implemented Interfaces:
    com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
    Enclosing class:
    RoleBasedAuthorizationStrategy

    public static class RoleBasedAuthorizationStrategy.ConverterImpl
    extends Object
    implements com.thoughtworks.xstream.converters.Converter
    Converter used to persist and retrieve the strategy from disk.

    This converter is there to manually handle the marshalling/unmarshalling of this strategy: Doing so is a little bit dirty but allows to easily update the plugin when new access controlled object (for the moment: Job and Project) will be introduced. If it's the case, there's only the need to update the getRoleMaps() method.

    • Constructor Detail

      • ConverterImpl

        public ConverterImpl()
    • Method Detail

      • canConvert

        public boolean canConvert​(Class type)
        Specified by:
        canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
      • marshal

        public void marshal​(Object source,
                            com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                            com.thoughtworks.xstream.converters.MarshallingContext context)
        Specified by:
        marshal in interface com.thoughtworks.xstream.converters.Converter
      • unmarshal

        public Object unmarshal​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Specified by:
        unmarshal in interface com.thoughtworks.xstream.converters.Converter