/** * Creates a DOM document from the input stream. */ public static Document createXmlDocument(InputStream in, boolean validate) throws Schema2BeansRuntimeException { return createXmlDocument(in, validate, null); }
public static int getPropertyIndex(Bean theRoot, String name) { String index = extractPropertyIndex(name); if (index != null) { int i = index.lastIndexOf('i'); if (i != -1) { // This is a removed property - return the old value return Integer.parseInt(index.substring(i+1)); } else { // Get the current index value Bean bean = getPropertyParent(theRoot, name); if (bean != null) { BeanProp bp = bean.beanProp(getPropertyName(name)); if (bp != null) return bp.idToIndex(Integer.parseInt(index, 16)); } } } return -1; }
protected void initFromNode(org.w3c.dom.Node doc, int options) throws Schema2BeansException { if (doc == null) { doc = GraphManager.createRootElementNode("sun-cmp-mappings"); // NOI18N if (doc == null) throw new Schema2BeansException(Common.getMessage( "CantCreateDOMRoot_msg", "sun-cmp-mappings")); } Node n = GraphManager.getElementNode("sun-cmp-mappings", doc); // NOI18N if (n == null) throw new Schema2BeansException(Common.getMessage( "DocRootNotInDOMGraph_msg", "sun-cmp-mappings", doc.getFirstChild().getNodeName())); this.graphManager.setXmlDocument(doc); // Entry point of the createBeans() recursive calls this.createBean(n, this.graphManager()); this.initialize(options); } public SunCmpMappings(int options)
Node n = GraphManager.createRootElementNode(dtdName); bean.graphManager.setXmlDocument(n); n = GraphManager.getElementNode(dtdName, n); bean.graphManager.completeRootBinding(bean, n);
protected void initOptions(int options) { // The graph manager is allocated in the bean root this.graphManager = new GraphManager(this); this.createRoot("constraints", "Constraints", // NOI18N Common.TYPE_1 | Common.TYPE_BEAN, Constraints.class); // Properties (see root bean comments for the bean graph) this.createProperty("check-info", // NOI18N CHECK_INFO, Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, CheckInfo.class); this.initialize(options); }
if (DDLogFlags.debug) { in = tee(in); return createXmlDocument(new InputSource(in), validate, er, null);
/** * Return the bean holding the property 'name' as a BaseBean object */ public BaseBean getPropertyParent(String name) { return (BaseBean) getPropertyParent(root, name); }
protected void initFromNode(org.w3c.dom.Node doc, int options) throws Schema2BeansException { if (doc == null) { doc = GraphManager.createRootElementNode("constraints"); // NOI18N if (doc == null) throw new Schema2BeansException(Common.getMessage( "CantCreateDOMRoot_msg", "constraints")); } Node n = GraphManager.getElementNode("constraints", doc); // NOI18N if (n == null) throw new Schema2BeansException(Common.getMessage( "DocRootNotInDOMGraph_msg", "constraints", doc.getFirstChild().getNodeName())); this.graphManager.setXmlDocument(doc); // Entry point of the createBeans() recursive calls this.createBean(n, this.graphManager()); this.initialize(options); } public Constraints(int options)
/** * This method is called by one of the properties of the bean * to notify of a change. This is the way the property uses to * signal all its ancestors about a property that has changed. */ void notifyInternal(BeanProp.InternalEvent ie) { if (this.changeListeners != null && ie.type == BeanProp.InternalEvent.CHANGED) { boolean addedGM = false; if (this.graphManager == null) { this.graphManager = new GraphManager(this); addedGM = true; } this.changeListeners. firePropertyChange(ie.getPropertyChangeEvent()); if (addedGM) { this.graphManager = null; } } if (this.binding != null) { BeanProp p = this.binding.getBeanProp(this); if (p != null) p.notifyInternal(ie, true); } }
for (int i = 0; i < len; i++) { BaseBean candidate = gm.getPropertyParent(props[i]); if (type.isInstance(candidate)) retVal.add(candidate);
protected void initFromNode(org.w3c.dom.Node doc, int options) throws Schema2BeansException { if (doc == null) { doc = GraphManager.createRootElementNode("validation"); // NOI18N if (doc == null) throw new Schema2BeansException(Common.getMessage( "CantCreateDOMRoot_msg", "validation")); } Node n = GraphManager.getElementNode("validation", doc); // NOI18N if (n == null) throw new Schema2BeansException(Common.getMessage( "DocRootNotInDOMGraph_msg", "validation", doc.getFirstChild().getNodeName())); this.graphManager.setXmlDocument(doc); // Entry point of the createBeans() recursive calls this.createBean(n, this.graphManager()); this.initialize(options); } public Validation(int options)
public static Document createXmlDocument(InputSource in, boolean validate) throws Schema2BeansException { return createXmlDocument(in, validate, null, null); }
protected void initOptions(int options) { // The graph manager is allocated in the bean root this.graphManager = new GraphManager(this); this.createRoot("deployment-plan", "DeploymentPlan", // NOI18N Common.TYPE_1 | Common.TYPE_BEAN, DeploymentPlan.class); // Properties (see root bean comments for the bean graph) initPropertyTables(1); this.createProperty("file-entry", // NOI18N FILE_ENTRY, Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, FileEntry.class); this.initialize(options); }
protected void initFromNode(org.w3c.dom.Node doc, int options) throws Schema2BeansException { if (doc == null) { doc = GraphManager.createRootElementNode("deployment-plan"); // NOI18N if (doc == null) throw new Schema2BeansException(Common.getMessage( "CantCreateDOMRoot_msg", "deployment-plan")); } Node n = GraphManager.getElementNode("deployment-plan", doc); // NOI18N if (n == null) throw new Schema2BeansException(Common.getMessage( "DocRootNotInDOMGraph_msg", "deployment-plan", doc.getFirstChild().getNodeName())); this.graphManager.setXmlDocument(doc); // Entry point of the createBeans() recursive calls this.createBean(n, this.graphManager()); this.initialize(options); } public DeploymentPlan(int options)
public static Wizard createGraph(java.io.InputStream in, boolean validate) throws org.netbeans.modules.schema2beans.Schema2BeansException { Document doc = GraphManager.createXmlDocument(in, validate); return createGraph(doc); }
protected void initOptions(int options) { // The graph manager is allocated in the bean root this.graphManager = new GraphManager(this); this.createRoot("sun-cmp-mappings", "SunCmpMappings", // NOI18N Common.TYPE_1 | Common.TYPE_BEAN, SunCmpMappings.class); // Properties (see root bean comments for the bean graph) initPropertyTables(1); this.createProperty("sun-cmp-mapping", // NOI18N SUN_CMP_MAPPING, Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, SunCmpMapping.class); this.initialize(options); }
protected void initFromNode(org.w3c.dom.Node doc, int options) throws Schema2BeansException { if (doc == null) { doc = GraphManager.createRootElementNode("wizard"); // NOI18N if (doc == null){ throw new Schema2BeansException(Common.getMessage( "CantCreateDOMRoot_msg", "wizard")); } } Node n = GraphManager.getElementNode("wizard", doc); // NOI18N if (n == null){ throw new Schema2BeansException(Common.getMessage( "DocRootNotInDOMGraph_msg", "wizard", doc.getFirstChild().getNodeName())); } this.graphManager.setXmlDocument(doc); // Entry point of the createBeans() recursive calls this.createBean(n, this.graphManager()); this.initialize(options); } public Wizard(int options)
public static Validation createGraph(java.io.InputStream in, boolean validate) throws org.netbeans.modules.schema2beans.Schema2BeansException { Document doc = GraphManager.createXmlDocument(in, validate); return createGraph(doc); }
protected void initOptions(int options) { // The graph manager is allocated in the bean root this.graphManager = new GraphManager(this); this.createRoot("wizard", "Wizard", // NOI18N Common.TYPE_1 | Common.TYPE_BEAN, Wizard.class); // Properties (see root bean comments for the bean graph) this.createProperty("name", // NOI18N NAME, Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, String.class); this.createProperty("field-group", // NOI18N FIELD_GROUP, Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, FieldGroup.class); this.initialize(options); }
public static Constraints createGraph(java.io.InputStream in, boolean validate) throws org.netbeans.modules.schema2beans.Schema2BeansException { Document doc = GraphManager.createXmlDocument(in, validate); return createGraph(doc); }