public void safeput(String name, PropertyInterface property) { addField("meta" + name, property); if (property instanceof PropertyClass) { ((PropertyClass) property).setObject(this); ((BaseProperty) property).setName(name); } }
PropertyClass property = (PropertyClass) Class.forName(classType).newInstance(); property.setName(name); property.setObject(this); property.fromXML(pcel); safeput(name, property);
@Override public Object clone() { PropertyClass pclass = (PropertyClass) super.clone(); pclass.setObject(getObject()); pclass.setClassType(getClassType()); return pclass; }
@Override public void beginWikiClassProperty(String name, String type, FilterEventParameters parameters) throws WikiStreamException { ComponentManager componentManager = this.componentManagerProvider.get(); PropertyClassProvider provider; // First try to use the specified class type as hint. try { if (componentManager.hasComponent(PropertyClassProvider.class, type)) { provider = componentManager.getInstance(PropertyClassProvider.class, type); } else { // In previous versions the class type was the full Java class name of the property class // implementation. Extract the hint by removing the Java package prefix and the Class suffix. String classType = StringUtils.removeEnd(StringUtils.substringAfterLast(type, "."), "Class"); provider = componentManager.getInstance(PropertyClassProvider.class, classType); } } catch (ComponentLookupException e) { throw new WikiStreamException(String.format( "Failed to get instance of the property class provider for type [%s]", type), e); } this.currentClassPropertyMeta = provider.getDefinition(); // We should use PropertyClassInterface (instead of PropertyClass, its default implementation) but it // doesn't have the set methods and adding them would breaks the backwards compatibility. We make the // assumption that all property classes extend PropertyClass. this.currentClassProperty = (PropertyClass) provider.getInstance(); this.currentClassProperty.setName(name); this.currentClassProperty.setObject(this.currentXClass); this.currentXClass.safeput(name, this.currentClassProperty); }
PropertyClass property = (PropertyClass) Class.forName(classType).newInstance(); property.setName(name); property.setObject(bclass); session.load(property, property); bclass.addField(name, property);
prop2.setObject(property.getObject()); ltransaction.rollback();
if (pmclass != null) { PropertyClass pclass = (PropertyClass) pmclass.newObject(context); pclass.setObject(bclass); pclass.setName(propName); pclass.setPrettyName(propName);