@Override public String toString() { return getClass().getSimpleName()+"[" + getName() + ", " + getImplementingClass().getSimpleName() + "]"; }
for (Constructor<?> next : getImplementingClass().getConstructors()) { if (argumentType == VOID_CLASS) { if (next.getParameterTypes().length == 0) { throw new ConfigurationException("Class " + getImplementingClass() + " has no constructor with a single argument of type " + argumentType);
public T newInstance(Object theArgument) { try { if (theArgument == null) { return getConstructor(null).newInstance(); } return getConstructor(theArgument).newInstance(theArgument); } catch (Exception e) { throw new ConfigurationException("Failed to instantiate type:" + getImplementingClass().getName(), e); } }
if (next instanceof IRuntimeDatatypeDefinition) { myDatatypeToDefinition.put(next.getImplementingClass(), next); ourLog.trace("Not adding specialization: {}", next.getImplementingClass()); String qualifiedName = next.getImplementingClass().getName(); if (datatypeAttributeNameToDefinition.containsKey(attrName)) { BaseRuntimeElementDefinition<?> existing = datatypeAttributeNameToDefinition.get(attrName); throw new ConfigurationException("More than one child of " + getElementName() + " matches attribute name " + attrName + ". Found [" + existing.getImplementingClass().getName() + "] and [" + next.getImplementingClass().getName() + "]"); myDatatypeToAttributeName.put(next.getImplementingClass(), attrName);
if (next instanceof RuntimeResourceDefinition) { if ("Bundle".equals(next.getName())) { if (!IBaseBundle.class.isAssignableFrom(next.getImplementingClass())) { throw new ConfigurationException("Resource type declares resource name Bundle but does not implement IBaseBundle");
for (Iterator<String> iter = new TreeSet<String>(nextChild.getValidChildNames()).iterator(); iter.hasNext(); ) { BaseRuntimeElementDefinition<?> childByName = nextChild.getChildByName(iter.next()); b.append(childByName.getImplementingClass().getSimpleName()); if (iter.hasNext()) { b.append(", ");
Class<? extends IBase> type2 = myContext.getElementDefinition("code").getImplementingClass(); childDef = theChild.getChildElementDefinitionByDatatype(type2); childName = theChild.getChildNameByDatatype(type2); if (Modifier.isAbstract(nextSuperType.getModifiers()) == false) { BaseRuntimeElementDefinition<?> def = myContext.getElementDefinition((Class<? extends IBase>) nextSuperType); Class<?> nextChildType = def.getImplementingClass(); childDef = theChild.getChildElementDefinitionByDatatype((Class<? extends IBase>) nextChildType); childName = theChild.getChildNameByDatatype((Class<? extends IBase>) nextChildType);
if (Date.class.equals(genericType)) { BaseRuntimeElementDefinition<?> dateTimeDef = theContext.getElementDefinition("dateTime"); parameterType = dateTimeDef.getImplementingClass(); } else if (String.class.equals(genericType) || genericType == null) { BaseRuntimeElementDefinition<?> dateTimeDef = theContext.getElementDefinition("string"); parameterType = dateTimeDef.getImplementingClass();
if (IBaseMetaType.class.isAssignableFrom(metaChild.getImplementingClass())) { IBaseMetaType newType = (IBaseMetaType) metaChild.newInstance(); theValues = Collections.singletonList(newType);
Class<? extends IPrimitiveType<?>> uriType = (Class<? extends IPrimitiveType<?>>) myContext.getElementDefinition("uri").getImplementingClass(); List<? extends IPrimitiveType<?>> allUris = terser.getAllPopulatedChildElementsOfType(nextResource, uriType); for (IPrimitiveType<?> nextRef : allUris) {
@Override public String toString() { return getClass().getSimpleName()+"[" + getName() + ", " + getImplementingClass().getSimpleName() + "]"; }
for (Constructor<?> next : getImplementingClass().getConstructors()) { if (argumentType == VOID_CLASS) { if (next.getParameterTypes().length == 0) { throw new ConfigurationException("Class " + getImplementingClass() + " has no constructor with a single argument of type " + argumentType);
public T newInstance(Object theArgument) { try { if (theArgument == null) { return getConstructor(null).newInstance(); } return getConstructor(theArgument).newInstance(theArgument); } catch (Exception e) { throw new ConfigurationException("Failed to instantiate type:" + getImplementingClass().getName(), e); } }
if (next instanceof IRuntimeDatatypeDefinition) { myDatatypeToDefinition.put(next.getImplementingClass(), next); ourLog.trace("Not adding specialization: {}", next.getImplementingClass()); String qualifiedName = next.getImplementingClass().getName(); if (datatypeAttributeNameToDefinition.containsKey(attrName)) { BaseRuntimeElementDefinition<?> existing = datatypeAttributeNameToDefinition.get(attrName); throw new ConfigurationException("More than one child of " + getElementName() + " matches attribute name " + attrName + ". Found [" + existing.getImplementingClass().getName() + "] and [" + next.getImplementingClass().getName() + "]"); myDatatypeToAttributeName.put(next.getImplementingClass(), attrName);
if (next instanceof RuntimeResourceDefinition) { if ("Bundle".equals(next.getName())) { if (!IBaseBundle.class.isAssignableFrom(next.getImplementingClass())) { throw new ConfigurationException("Resource type declares resource name Bundle but does not implement IBaseBundle");
for (Iterator<String> iter = new TreeSet<String>(nextChild.getValidChildNames()).iterator(); iter.hasNext(); ) { BaseRuntimeElementDefinition<?> childByName = nextChild.getChildByName(iter.next()); b.append(childByName.getImplementingClass().getSimpleName()); if (iter.hasNext()) { b.append(", ");
Class<? extends IBase> type2 = myContext.getElementDefinition("code").getImplementingClass(); childDef = theChild.getChildElementDefinitionByDatatype(type2); childName = theChild.getChildNameByDatatype(type2); if (Modifier.isAbstract(nextSuperType.getModifiers()) == false) { BaseRuntimeElementDefinition<?> def = myContext.getElementDefinition((Class<? extends IBase>) nextSuperType); Class<?> nextChildType = def.getImplementingClass(); childDef = theChild.getChildElementDefinitionByDatatype((Class<? extends IBase>) nextChildType); childName = theChild.getChildNameByDatatype((Class<? extends IBase>) nextChildType);
if (Date.class.equals(genericType)) { BaseRuntimeElementDefinition<?> dateTimeDef = theContext.getElementDefinition("dateTime"); parameterType = dateTimeDef.getImplementingClass(); } else if (String.class.equals(genericType) || genericType == null) { BaseRuntimeElementDefinition<?> dateTimeDef = theContext.getElementDefinition("string"); parameterType = dateTimeDef.getImplementingClass();
if (IBaseMetaType.class.isAssignableFrom(metaChild.getImplementingClass())) { IBaseMetaType newType = (IBaseMetaType) metaChild.newInstance(); theValues = Collections.singletonList(newType);
Class<? extends IPrimitiveType<?>> uriType = (Class<? extends IPrimitiveType<?>>) myContext.getElementDefinition("uri").getImplementingClass(); List<? extends IPrimitiveType<?>> allUris = terser.getAllPopulatedChildElementsOfType(nextResource, uriType); for (IPrimitiveType<?> nextRef : allUris) {