A characteristic feature of magnetic impurities in superconductors is the existence of a spin- and paritychanging quantum phase transition (known as “0-π” transition) which has been observed in scanning tunneling microscopy (STM) and quantum transport experiments. Using the Abelian bosonization technique, here we analyze the ground-state properties and the quantum phase diagram of an artificial “Shiba impurity” in a onedimensional superconductor. Within the bosonization framework, the ground-state properties are determined by simple solitonlike solutions of the classical equations of motion of the bosonic fields, whose topological charge is related to the spin and fermion-parity quantum numbers. Interestingly, the same theoretical framework can be used in the case of a bulk superconductor, where previous results can be rederived in an elegant fashion. Our results indicate that the quantum phase diagram of a magnetic impurity in the superconductor can be strongly affected by geometrical and dimensional effects. Exploiting this fact, in the one-dimensional case we propose an experimental superconducting setup in which a novel parity-preserving, spin-changing “0-0” transition is predicted.