public String value() { return name(); }
public DMNModelInstrumentedBase getParentDRDElement() { if( this instanceof TDRGElement || (this instanceof TArtifact) || (this instanceof TItemDefinition && parent != null && parent instanceof TDefinitions)) { return this; } else if( parent != null ) { return parent.getParentDRDElement(); } else { return null; } }
public void setLocation(Location location) { this.location = new RowLocation(location); }
private static void processQNameURIs(ItemDefinition iDef) { final QName typeRef = iDef.getTypeRef(); if (typeRef != null && XMLConstants.NULL_NS_URI.equals(typeRef.getNamespaceURI())) { final String namespace = iDef.getNamespaceURI(typeRef.getPrefix()); iDef.setTypeRef(new QName(namespace, typeRef.getLocalPart(), typeRef.getPrefix())); } for (ItemDefinition comp : iDef.getItemComponent()) { processQNameURIs(comp); } } }
private static void createAndAddDependency(final ItemDefinition itemDefinition, final ItemDefinition dependency) { final ItemDefinition newDependency = new TItemDefinition(); newDependency.setName("_" + itemDefinition.getName() + "-" + dependency.getName()); newDependency.setTypeRef(new QName(TEST_NS, dependency.getName())); itemDefinition.getItemComponent().add(newDependency); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("RowLocation [getLineNumber()=").append(getLineNumber()).append(", getColumnNumber()=").append(getColumnNumber()).append(", getCharacterOffset()=").append(getCharacterOffset()).append( ", getPublicId()=") .append(getPublicId()).append(", getSystemId()=").append(getSystemId()).append("]"); return builder.toString(); } }
private Definitions buildSimplifiedDefinitions(final String namespace, final String... decisions) { final Definitions def = new TDefinitions(); def.setNamespace(namespace); for (final String d : decisions) { final Decision dec = new TDecision(); dec.setName(d); def.getDrgElement().add(dec); def.addChildren(dec); dec.setParent(def); } return def; }
private int indexOfItemDefinitionByName(final String name, final List<ItemDefinition> itemDefinitions) { int index = 0; for (final ItemDefinition itemDefinition : itemDefinitions) { if (itemDefinition.getName().equals(name)) { return index; } index++; } return -1; } }
private DecisionNodeImpl buildSimplifiedDecisionNode(final Definitions def, final String name) { return new DecisionNodeImpl(def.getDrgElement().stream().filter(drg -> drg.getName().equals(name)).filter(Decision.class::isInstance).map(Decision.class::cast).findFirst().get()); }
@Override public String getNamespaceURI( String prefix ) { if( this.nsContext != null && this.nsContext.containsKey( prefix ) ) { return this.nsContext.get( prefix ); } if( this.parent != null ) { return parent.getNamespaceURI( prefix ); } return null; }
public static BuiltinAggregator fromValue( final String v ) { return valueOf( v ); }
public static DecisionTableOrientation fromValue( final String v ) { for ( DecisionTableOrientation c : DecisionTableOrientation.values() ) { if ( c.value.equals( v ) ) { return c; } } throw new IllegalArgumentException( v ); }
public static HitPolicy fromValue( final String v ) { for ( HitPolicy c : HitPolicy.values() ) { if ( c.value.equals( v ) ) { return c; } } throw new IllegalArgumentException( v ); }
public static AssociationDirection fromValue( final String v ) { for ( AssociationDirection c : AssociationDirection.values() ) { if ( c.value.equals( v ) ) { return c; } } throw new IllegalArgumentException( v ); }
public static FunctionKind fromValue(String v) { for (FunctionKind c: FunctionKind.values()) { if (c.value.equals(v)) { return c; } } if ("Java".equalsIgnoreCase(v)) { return FunctionKind.JAVA; } throw new IllegalArgumentException(v); }
/** * Align to DMN v1.2 */ @Override public void setKind(FunctionKind value) { this.getAdditionalAttributes().put(KIND_QNAME, value.value()); }
private static List<ItemDefinition> getBaseListOfItemDefinitions(final int nameIndexFrom) { final List<ItemDefinition> itemDefinitions = new ArrayList<>(); for (int i = nameIndexFrom; i < NUMBER_OF_BASE_ITEM_DEFINITIONS + nameIndexFrom; i++) { final ItemDefinition it = new TItemDefinition(); it.setName(ITEM_DEFINITION_NAME_BASE + i); itemDefinitions.add(it); } return itemDefinitions; }
@Override public DMNModelInstrumentedBase getParentDRDElement() { if( this instanceof TDRGElement || this instanceof TDecisionService // in DMN v1.1 it was a bug in the schema as decision service missed to inherit from DRGElement || (this instanceof TArtifact) || (this instanceof TItemDefinition && parent != null && parent instanceof TDefinitions)) { return this; } else if( parent != null ) { return parent.getParentDRDElement(); } else { return null; } }
@Override public void setLocation(Location location) { this.location = new RowLocation(location); }
@Override public String getNamespaceURI( String prefix ) { if( this.nsContext != null && this.nsContext.containsKey( prefix ) ) { return this.nsContext.get( prefix ); } if( this.parent != null ) { return parent.getNamespaceURI( prefix ); } return null; }