public Lifecycle getLifecycleMapping( String lifecycleId ) throws IOException, XmlPullParserException { if ( lifecycleMappings == null ) { LifecycleConfiguration lifecycleConfiguration; try ( Reader reader = ReaderFactory.newXmlReader( getDescriptorStream( LIFECYCLE_DESCRIPTOR ) ) ) { lifecycleConfiguration = new LifecycleMappingsXpp3Reader().read( reader ); } lifecycleMappings = new HashMap<>(); for ( Lifecycle lifecycle : lifecycleConfiguration.getLifecycles() ) { lifecycleMappings.put( lifecycle.getId(), lifecycle ); } } return lifecycleMappings.get( lifecycleId ); }
checkUnknownAttribute( parser, name, tagName, strict ); while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) if ( checkFieldWithDuplicate( parser, "id", null, parsed ) ) lifecycle.setId( interpolatedTrimmed( parser.nextText(), "id" ) ); else if ( checkFieldWithDuplicate( parser, "phases", null, parsed ) ) phases.add( parsePhase( parser, strict ) ); checkUnknownElement( parser, strict ); checkUnknownElement( parser, strict );
/** * Method getBooleanValue. * * @param s * @param parser * @param attribute * @throws XmlPullParserException * @return boolean */ private boolean getBooleanValue( String s, String attribute, XmlPullParser parser ) throws XmlPullParserException { return getBooleanValue( s, attribute, parser, null ); } //-- boolean getBooleanValue( String, String, XmlPullParser )
checkUnknownAttribute( parser, name, tagName, strict ); while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) if ( checkFieldWithDuplicate( parser, "id", null, parsed ) ) lifecycle.setId( getTrimmedValue( parser.nextText() ) ); else if ( checkFieldWithDuplicate( parser, "phases", null, parsed ) ) phases.add( parsePhase( parser, strict ) ); checkUnknownElement( parser, strict ); checkUnknownElement( parser, strict );
checkUnknownAttribute( parser, name, tagName, strict ); while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) lifecycleConfiguration.setLifecycles( lifecycles ); lifecycles.add( parseLifecycle( parser, strict ) ); checkUnknownElement( parser, strict );
/** * @see ReaderFactory#newXmlReader * * @param reader * @throws IOException * @throws XmlPullParserException * @return LifecycleConfiguration */ public LifecycleConfiguration read( Reader reader ) throws IOException, XmlPullParserException { return read( reader, true ); } //-- LifecycleConfiguration read( Reader )
while ( parser.nextTag() == XmlPullParser.START_TAG ) if ( checkFieldWithDuplicate( parser, "id", null, parsed ) ) lifecycle.setId( getTrimmedValue( parser.nextText() ) ); else if ( checkFieldWithDuplicate( parser, "phases", null, parsed ) ) phases.add( parsePhase( "phase", parser, strict ) );
while ( parser.nextTag() == XmlPullParser.START_TAG ) if ( checkFieldWithDuplicate( parser, "id", null, parsed ) ) phase.setId( getTrimmedValue( parser.nextText() ) ); else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) ) executions.add( parseExecution( "execution", parser, strict ) ); else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
while ( parser.nextTag() == XmlPullParser.START_TAG ) if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) ) else if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) ) goals.add( getTrimmedValue( parser.nextText() ) );
/** * Method getDateValue. * * @param s * @param parser * @param attribute * @throws XmlPullParserException * @return Date */ private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser ) throws XmlPullParserException { return getDateValue( s, attribute, null, parser ); } //-- java.util.Date getDateValue( String, String, XmlPullParser )
lifecycleConfiguration = parseLifecycleConfiguration( parser, strict ); lifecycleConfiguration.setModelEncoding( parser.getInputEncoding() ); parsed = true;
/** * @see ReaderFactory#newXmlReader * * @param reader * @param strict * @throws IOException * @throws XmlPullParserException * @return LifecycleConfiguration */ public LifecycleConfiguration read( Reader reader, boolean strict ) throws IOException, XmlPullParserException { XmlPullParser parser = new MXParser(); parser.setInput( reader ); initParser( parser ); return read( parser, strict ); } //-- LifecycleConfiguration read( Reader, boolean )
/** * Method interpolatedTrimmed. * * @param value * @param context * @return String */ private String interpolatedTrimmed( String value, String context ) { return getTrimmedValue( contentTransformer.transform( value, context ) ); } //-- String interpolatedTrimmed( String, String )
lifecycleConfiguration.setLifecycles( lifecycles ); lifecycles.add( parseLifecycle( "lifecycle", parser, strict ) );
checkUnknownAttribute( parser, name, tagName, strict ); while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) if ( checkFieldWithDuplicate( parser, "id", null, parsed ) ) phase.setId( getTrimmedValue( parser.nextText() ) ); else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) ) executions.add( parseExecution( parser, strict ) ); checkUnknownElement( parser, strict ); else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) ) checkUnknownElement( parser, strict );
checkUnknownAttribute( parser, name, tagName, strict ); while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) lifecycleConfiguration.setLifecycles( lifecycles ); lifecycles.add( parseLifecycle( parser, strict ) ); checkUnknownElement( parser, strict );
/** * @see ReaderFactory#newXmlReader * * @param reader * @throws IOException * @throws XmlPullParserException * @return LifecycleConfiguration */ public LifecycleConfiguration read( Reader reader ) throws IOException, XmlPullParserException { return read( reader, true ); } //-- LifecycleConfiguration read( Reader )
/** * Method getDateValue. * * @param s * @param parser * @param attribute * @throws XmlPullParserException * @return Date */ private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser ) throws XmlPullParserException { return getDateValue( s, attribute, null, parser ); } //-- java.util.Date getDateValue( String, String, XmlPullParser )
lifecycleConfiguration = parseLifecycleConfiguration( parser, strict ); lifecycleConfiguration.setModelEncoding( parser.getInputEncoding() ); parsed = true;
/** * Method interpolatedTrimmed. * * @param value * @param context * @return String */ private String interpolatedTrimmed( String value, String context ) { return getTrimmedValue( contentTransformer.transform( value, context ) ); } //-- String interpolatedTrimmed( String, String )