private String filterLocalName(String namespaceURI, String localName){ Version version = forNamespaceURI(namespaceURI); if((version).equals(Version.PMML_4_0)){ if(("Trend").equals(localName)){ return "Trend_ExpoSmooth"; } } return localName; }
private void updateSource(String namespaceURI){ if(("").equals(namespaceURI)){ return; } // End if if(this.sourceNamespaceURI != null && (this.sourceNamespaceURI).equals(namespaceURI)){ return; } Version version = Version.forNamespaceURI(namespaceURI); Version source = getSource(); if(source != null && !(source).equals(version)){ throw new IllegalStateException(); } // Keep the String reference of the namespaceURI argument, as opposed to getting one using Version#getNamespaceURI(). // If the same String instance is reused, which is typical, // then String#equals(String) will be able to return quickly by performing an identity comparison this.sourceNamespaceURI = namespaceURI; setSource(version); }
private void updateSource(String namespaceURI){ if(("").equals(namespaceURI)){ return; } // End if if(this.sourceNamespaceURI != null && (this.sourceNamespaceURI).equals(namespaceURI)){ return; } Version version = Version.forNamespaceURI(namespaceURI); Version source = getSource(); if(source != null && !(source).equals(version)){ throw new IllegalStateException(); } // Keep the String reference of the namespaceURI argument, as opposed to getting one using Version#getNamespaceURI(). // If the same String instance is reused, which is typical, // then String#equals(String) will be able to return quickly by performing an identity comparison this.sourceNamespaceURI = namespaceURI; setSource(version); }
static public PMML unmarshal(Version version) throws IOException, JAXBException { if(!(Version.PMML_4_3).equals(version)){ throw new IllegalArgumentException(); } try(InputStream is = getStream(version)){ return JAXBUtil.unmarshalPMML(new StreamSource(is)); } }