Extract extracts all metadata from source spec.
(source v1.SourceSpec, meta *Metadata)
| 37 | |
| 38 | // Extract extracts all metadata from source spec. |
| 39 | func (i JavaSourceInspector) Extract(source v1.SourceSpec, meta *Metadata) error { |
| 40 | from := util.FindAllDistinctStringSubmatch( |
| 41 | source.Content, |
| 42 | doubleQuotedFrom, |
| 43 | doubleQuotedFromF, |
| 44 | ) |
| 45 | to := util.FindAllDistinctStringSubmatch( |
| 46 | source.Content, |
| 47 | doubleQuotedTo, |
| 48 | doubleQuotedToD, |
| 49 | doubleQuotedToF, |
| 50 | doubleQuotedWireTap, |
| 51 | ) |
| 52 | kameletEips := util.FindAllDistinctStringSubmatch( |
| 53 | source.Content, |
| 54 | doubleQuotedKameletEip) |
| 55 | |
| 56 | hasRest := restRegexp.MatchString(source.Content) |
| 57 | |
| 58 | return i.extract(source, meta, from, to, kameletEips, hasRest) |
| 59 | } |
| 60 | |
| 61 | // ReplaceFromURI parses the source content and replace the `from` URI configuration with the a new URI. Returns true if it applies a replacement. |
| 62 | func (i JavaSourceInspector) ReplaceFromURI(source *v1.SourceSpec, newFromURI string) (bool, error) { |
nothing calls this directly
no test coverage detected