public psidev.psi.mi.xml.model.Position fromJaxb( psidev.psi.mi.xml254.jaxb.Position jPosition ) { if ( jPosition == null ) { throw new IllegalArgumentException( "You must give a non null JAXB Position." ); } psidev.psi.mi.xml.model.Position mPosition = new psidev.psi.mi.xml.model.Position(); //Initialise the model reading the Jaxb object //position mPosition.setPosition( jPosition.getPosition().longValue() ); return mPosition; }
public psidev.psi.mi.xml.model.Position fromJaxb( psidev.psi.mi.xml253.jaxb.PositionType jPosition ) { if ( jPosition == null ) { throw new IllegalArgumentException( "You must give a non null JAXB PositionType." ); } psidev.psi.mi.xml.model.Position mPosition = new psidev.psi.mi.xml.model.Position(); //Initialise the model reading the Jaxb object //position mPosition.setPosition( jPosition.getPosition().longValue() ); return mPosition; }
/** * It allows deleting the > or < char and create the Position * * @param stringPosition string to process * @return The new Position */ private static Position removeFirstCharAndConvert(String stringPosition) throws ConverterException { Position rangePosition; if (stringPosition.length() > 1) { String position = stringPosition.substring(1); if (!position.equals("")) { //We have a number no a empty String try { rangePosition = new Position(Long.valueOf(position)); } catch (Exception e) { throw new ConverterException("The range is bad formatted. Value:" + position); } } else throw new ConverterException("The range is bad formatted. Value:" + position); } else throw new ConverterException("The range is bad formatted. Value:" + stringPosition); return rangePosition; } }
value = new Position(Long.valueOf(position)); } catch (Exception e) { throw new ConverterException("The range is a certain sequence position but is bad formatted. Value:" + value);