Class AbstractDescriptorConverter

    • Constructor Detail

      • AbstractDescriptorConverter

        public AbstractDescriptorConverter()
        Creates a singleton descriptor converter and gets all vil pseudo types.
    • Method Detail

      • unmarshal

        public java.lang.Object unmarshal​(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                          com.thoughtworks.xstream.converters.UnmarshallingContext context)
        Unmarshals the current object to be read from the given reader in the specified unmarshaling context. This method translates the name back to the singleton instance.
        Specified by:
        unmarshal in interface com.thoughtworks.xstream.converters.Converter
        Parameters:
        reader - the input stream writer
        context - the marshaling context
        Returns:
        the unmarshaled object
      • addAttributes

        public void addAttributes​(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                                  OperationDescriptor operationDescriptor)
        Adds the attributes to the node.
        Parameters:
        writer - the output stream writer
        operationDescriptor - the OperationDescriptor
      • getTypeDescriptor

        private TypeDescriptor<?> getTypeDescriptor​(java.lang.String attribute)
        Gets the TypeDescriptor for a given attribute.
        Parameters:
        attribute - The attribute to be checked.
        Returns:
        the TypeDescriptor for the given attribute, null if not found.
      • getParameterTypes

        private TypeDescriptor<?>[] getParameterTypes​(java.lang.String attribute,
                                                      TypeDescriptor<?>[] parameters,
                                                      java.lang.String regex)
        Collects the types of the parameters.
        Parameters:
        attribute - The attribute to be parsed
        parameters - Array containing all types
        regex - Regex to filter the string
        Returns:
        Array with all types
      • getOperationDescriptor

        private java.lang.Object getOperationDescriptor​(java.lang.String name,
                                                        java.lang.Object result,
                                                        java.lang.Iterable<OperationDescriptor> iterable,
                                                        TypeDescriptor<?>[] parameters)
        Parameters:
        name - name of the attribute
        result - the object to be returned
        iterable - Iterable of OperationDescriptor
        parameters - Array with parameters
        Returns:
        the OperationDescriptor for a given attribute
      • setTypeRegistry

        public static void setTypeRegistry​(TypeRegistry registry)
        Setter for the type registry.
        Parameters:
        registry - The type registry to be set